blog.up-link.ro android bsd linux unix & open-source world

12Feb/102

How To Recover the root Password in FreeBSD

The password cannot be recovered. The following procedure will allow you to change the root password.

Do the following:

- when the following boot message appears

Hit [ENTER] to boot immediately, or any other key for command prompt.
Booting [kernel] in 10 seconds...

hit a key, just pick one EXCEPT the ENTER key. You'll get a prompt like:

disk1s1a:>

- type the following commands:

disk1s1a:>unload all
disk1s1a:>load kernel
disk1s1a:>boot -s

The boot process will now start, just wait until it asks you for a shell. Just hit
ENTER and 'sh' will be used as shell.

If you type 'mount' you will see that only your root partition ( / ) is mounted, you will have to mount  'usr' partition as well.

#mount /dev/ad0s1f /usr

Now you have to mount root partition as read-write enabled. Use the following command:

#mount -u /

The root partition should now be mounted read-write. Now you can use 'passwd' program to
change the root password.

#passwd

That's all, reboot the system and login with the new password.

Comments (2) Trackbacks (0)
  1. Really nice post you got here. Thanks for posting this info.

  2. It was rather interesting for me to read the article. Thanks!
    I like such topics and everything that is connected to them. I would like to read more on this blog soon.

    Julia S.


Leave a comment


No trackbacks yet.