Home FAQ How To Reset Or Recover Root User Password In FreeBSD
reset or recover root user password in FreeBSD

How To Reset Or Recover Root User Password In FreeBSD

By sk
75 Views

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 a 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 or recover 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

Boot into single user mode in FreeBSD

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

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

Enter full pathname of shell in FreeBSD

Now, you are landed in 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

Mount root file system in read and write mode. in FreeBSD

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

passwd

Enter a new password twice.

Setup new password for root user in FreeBSD

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.

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

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More