How To Reset Or Recover Root Password On FreeBSD 10

Let me show you How to Reset or Recover Root Password on FreeBSD 10.

My system:

root@Freebsd-unixmen:~ # uname -a
FreeBSD Freebsd-unixmen 10.1-RELEASE-p6 FreeBSD 10.1-RELEASE-p6 #0: Tue Feb 24 19:00:21 UTC 2015Ā Ā Ā Ā  [email protected]:/usr/obj/usr/src/sys/GENERICĀ  amd64
root@Freebsd-unixmen:~ #

Step 1: Start FreeBSD server/workstation.

bsd1

Step 2: type number 2 key to access single user mode

Next you will see the following prompt from system:

When prompted Enter full path name of shell or RETURN for /bin/sh:

bsd2

Press Enter key to boot into a single user mode. Next, you will be immediately dropped into a single user mode without a root password.

Step 3: MountĀ  the file system

You need to remount / (root) file system in read and write mode with mount command, type the following commands:

# mount -u /
# mount -a

bsd3

ifĀ  youĀ  getĀ  thisĀ  problem above . pleaseĀ  fix itĀ  like this.

#fsck -y
# mount -u /
# mount -a

bsd4

Step 4: Setup a new password for root user:

# passwd

Next type exit command to boot FreeBSD into multi-user mode environment:

# exit; exit 

OR You can just reboot the system:

# sync;sync
# reboot

Enjoy !!