PwdRecover
Jump To: Support > KB > NetManager > PwdRecover
Recovering a corrupt password database
If you see errors on the console such as the following or you cannot log in even as root on the console, then perhaps the password database is corrupted:
netmanager sshd[7948] fatal privilege separation user sshd does not exist netmanager atrun[3536] cannot get uid for 'nobody'
This can happen if the power is switched off immediately after the password database was modified.
To fix we can use the nightly backups:
- Press the power button, this should turn the machine off cleanly. If it does not, hold the power button until it goes off
- Power the server back on and wait for the Boot Menu
- At the Boot Menu, pick option 5 Single User
- At
Enter pathname of shell or RETURN for /bin/sh:
press Return - If you get prompted
Terminal type? [unknown]
, entervt100
and press Return - You should now be at a # prompt
- Run the following to check the file systems:
fsck -y
- Run the following to mount the file systems in writeable mode:
mount -a
- Find the latest snapshot by date by running:
ls /var/snapshot
# ls /var/snapshot 01032018-0000.cnf 04032018-0000.cnf 07032018-0000.cnf 27022018-0000.cnf 01032018-0000.tgz 04032018-0000.tgz 07032018-0000.tgz 27022018-0000.tgz 02032018-0000.cnf 05032018-0000.cnf 08032018-0000.cnf 28022018-0000.cnf 02032018-0000.tgz 05032018-0000.tgz 08032018-0000.tgz 28022018-0000.tgz 03032018-0000.cnf 06032018-0000.cnf 26022018-0000.cnf 03032018-0000.tgz 06032018-0000.tgz 26022018-0000.tgz
- Take a note of the file with the latest date (and the one before it, just in case). In this case it is
08032018-0000.tgz
which backed up at midnight on 8th March 2018 - Run the following to change to the configuration directory:
cd /etc
- Extract the group and user files with the following (replace the filename as above):
tar -xzf /var/snapshot/08032018-0000.tgz master.passwd group
- Clean up and regenerate the password database with the following commands:
cp master.passwd ptmp rm -f pwd.db* spwd.db* pwd_mkdb -p ptmp
- Check standard users exist by using
id
followed by the user name. Examples:# id root uid=0(root) gid=0(wheel) groups=0(wheel),2(kmem),3(sys),4(tty),5(operator) # id ncadmin uid=52(ncadmin) gid=0(wheel) groups=0(wheel) # id nobody uid=32767(nobody) gid=9999 groups=9999
- You may also reset passwords from here by using the
passwd
command:# passwd root Changing password for root. New Password: Retype New Password:
- When finished type
reboot