This tutorial by FreeBSD user M.el Khamlichi shows us how to reset or recover your root password on FreeBSD 10.

Original post: http://www.unixmen.com/reset-or-recover-root-password-on-freebsd-10/

FreeBSD

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     root@amd64-builder.daemonology.net:/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 !!