Packetwatch.net

Forgotten root password in FreeBSD



Last modified: Aug. 5, 2008

Contents
1 - Summary
2 - Start single-user mode
3 - Check file systems
4 - Mount file systems
5 - Reset root password


1 - Summary

This little guide will show how to reset the root password in case you
forgot it. For this guide to work you will need to be running FreeBSD.


2 - Start single-user mode

Press the Spacebar when you see the following.

Hit [Enter] to boot immediately, or any other key for command prompt.

Type the following to boot into single-user mode.

OK boot -s

Press [Enter] to get to the shell.


3 - Check file systems

Run fsck to check the consistency of the file systems.
# fsck -p


4 - Mount file systems

Mount all the file systems.
# mount -a


5 - Reset root password

Reset the root password and then reboot.
# passwd root
Changing local password for root
New Password: ********
Retype New Password: ********
# reboot


Last modified: Wed Dec 31 19:00:00 1969 EST
Packetwatch Research 2002-2008.