How to reset or recover root user password in FreeBSD 10.2

Today, I forgot the FreeBSD 10.2 root user password. I tried hard to remember it, but no luck. I know how to reset the root user password in Linux, however I am new to Unix-like operating systems. I have been using FreeBSD just for few weeks now. So, I don’t have a clue how to do it. After a bit of googling and testing, I did it successfully. Here is the procedure for how to reset root user password in FreeBSD 10.2.

Be mindful that this method will only work if you have the physical access to the server. For remote systems and VPS, you must need the service provider’s help. If you have physical access to your FreeBSD server, then follow me.

Power on your FreeBSD server. At the boot menu, press number in your keyboard. Refer the screenshot

FreeBSD 10.2 [Running] - Oracle VM VirtualBox_009

Then, the following message will appear. Just press Enter to continue.

Enter full pathname of shell or RETURN for /bin/sh:

FreeBSD 10.2 [Running] - Oracle VM VirtualBox_010

Now, you’ll be reached the single user mode without root user password.

After reaching the single user mode, you need to mount the root (/) file system in read and write mode.

To do so, run:

mount -u /
mount -a

FreeBSD 10.2 [Running] - Oracle VM VirtualBox_011

Now, setup new password to the root user using command:

passwd

Enter a new password twice.

FreeBSD 10.2 [Running] - Oracle VM VirtualBox_013

Finally, exit from the single user mode with command:

exit

Or, reboot your system using the following commands:

sync;sync
reboot

Similarly, you can reset the any user’s password in single user mode. To reset the other user’s password, for example ostechnix, just use:

passwd ostechnix

And the rest is same as described above

That’s it. You now know how to reset the password for root user. If you find this tutorial helpful, please share it on your social networks and support us. For latest articles and updates, subscribe to our newsletter service.

You may also want to reset the root user password in Linux operating systems such as Arch Linux, CentOS, Ubuntu etc. If yes, refer the following link.

Thanks for reading! Have a good day!!

You may also like...