Reset admin/root password in FreeBSD (howto)

  1. Turn the system off.
  2. Hit ESC when the OS boots up
  3. Choose to boot into Single User Mode (option 4)
  4. Select the default shell (/bin/sh)
  5. When the machine is booted up and you see the prompt, enter:
    • mount -u /
    • mount -a
  6. Type passwd to reset the password
  7. Enter the new password and confirm it
  8. Type reboot to reboot the machine (or press the shutdown button to reboot)

4 thoughts on “Reset admin/root password in FreeBSD (howto)

  1. kace says:

    This is only a feature for boxes that are in a secure location. Anywhere else, someone who’s alone with your machine could reboot it and get root!

    For machines that are not in a secure location, you should edit “/etc/ttys” and mark the console as insecure. Then, after you reboot (or HUP init), no one can go to single-user mode without first entering the root password. … Bad for lost passwords, but good for security. :)

  2. Pingback: Reset admin/root password in FreeBSD (howto) | BSD News

  3. Ciprian says:

    It happened to me once and it was quite complicated to discover this even though it’s similar to linux. I agree you should put the console as insecure but then what? You can use a boot cd with a portable cd drive so the box is more protected. Any other ideas?

  4. socialdefect says:

    When someone has physical access to your computer it is also possible to get around the password in single user mode by using a livecd > mount the system partition and change the password hash in /etc/shadow.
    So I would also suggest to set a boot password in the BIOS so one would need to reset the bios chip on the motherboard to be able to boot a live medium.

    Nothing is completely safe but we can try to make it as hard as possible ;)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>