Recovering forgotten root password

| 1 Comment | No TrackBacks
How to reset the root password if you forget it:

First, reboot the machine into single user mode. You do this by hitting space when FreeBSD says to "Hit [Enter] to boot immediately or any other key for command prompt", leaving you with the very cryptic "ok " prompt. Then type in :

ok boot -s
Once it finishes booting, then you can do:
# mount -u / ... mount root file system read/write
# mount /usr ... mount /usr file system (if seperate)
# passwd root .... change the password for root
Enter new password:
Enter password again:
# ^D ... enter ctrl-D to continue with startupbr>
This is all courtesy of the Complete FreeBSD book, by Lehey. I particularily love the chapter where he goes over the boot screen line by line, telling you what FreeBSD is doing.

No TrackBacks

TrackBack URL: http://linux.amazingdev.com/cgi-bin/mt/mt-tb.cgi/66

1 Comment

This is good when in /etc/ttys console is declared secure. You get stuck when /etc/ttys has console as insecure. In that case boot with install cd (only IDE cdrom worked in my case - no usb) than go to post install config -> fixit option -> use the live cd. Once your are in fixit console mount the HD and change console entry in /etc/ttys to secure, Reboot and than go single user mode as explained above and follow.

Have fun

-Yantragna

Leave a comment

About this Entry

This page contains a single entry by Jonathan published on February 13, 2004 7:46 AM.

How to use FreeBSD Questions was the previous entry in this blog.

init.d and security levels is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.