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 2 in your keyboard. Refer the screenshot
Then, the following message will appear. Just press Enter to continue.
Enter full pathname of shell or RETURN for /bin/sh:
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
Now, setup new password to the root user using command:
passwd
Enter a new password twice.
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:
- Subscribe to our Email Newsletter : Sign Up Now
- Support OSTechNix : Donate Via PayPal
- Download free E-Books and Videos : OSTechNix on TradePub
- Connect with us: Reddit | Facebook | Twitter | LinkedIn | RSS feeds
Have a Good day!!