System: Restoring a lost root password(last edit: 2000-11-23)
For some reason you have forgotten your root password
After you stopped banging your head against the wall, this is how you can fix it:
When the bootstrap sais something like:
Hit [ENTER} to boot immediately, or any other key for command prompt.
Booting [kernel] in 8 seconds.....
hit a key, just pick one EXCEPT the ENTER key. You'll get a prompt like:
Type the following commands:
The boot process will now start, just let it go until it asks you for a shell. Just hit
ENTER and 'sh' will be used as shell (which is a good thing). If you type 'mount' you'll
see that only your root partition is mounted, you'll have to mount your 'usr' partition so
you can use the 'passwd' command. Type something like this:
host#mount /dev/ad0s1f /usr
Check if the mount was successfull with the 'mount' command. If you have looked at the
mount output gave you, you proballey have seen that your root partition was mounted
read-only. You must change this with the command:
host#mount -u /
The root partition should now be mounted read-write. Now you can use 'passwd' program to
change the root password.
-u The -u flag indicates that the status of an already mounted file
system should be changed. Any of the options discussed above
(the -o option) may be changed; also a file system can be changed
from read-only to read-write or vice versa. An attempt to change
from read-write to read-only will fail if any files on the
filesystem are currently open for writing unless the -f flag is
also specified. The set of options is determined by applying the
options specified in the argument to -o and finally applying the
-r or -w option.
Click here to go back to the index.