How To Reset Or Recover Root Password On OPNsense

|
Last Updated:
|
|

How To Reset Or Recover Root Password On OPNsense? So for some reason you just forgot the root password for your OPNsense router/firewall and you are now locked out and don’t know what to do!!? Relax as in this article, we will show you how you can recover the password from single user mode.

You can also check our previous guide on how to install OPNsense Firewall on VirtualBox.

Resetting Or Recovering Root Password On OPNsense

Boot OPNsense into Single User Mode

The first step in recovering lost or forgotten root password for opnsense router/firewall is to boot it to single user mode.

OPNsense single user mode

Therefore reboot OPNsense and once it boots, immediately press 2 on your keyboard to switch to Single User Mode from the loader menu as shown in the screenshot above.

After it boots, you will be prompted to select the shell. Press Enter to start /bin/sh.

Mount Root Partition in Read/Write Mode

Before you can reset the password, you need to remount the drives as rewritable.

mount -o rw /

OR to mount all the drives;

mount -a -t ufs

Reset Or Recover Root Password On OPNsense

Once you have mounted the drives, run the following command to reset the root password.

opnsense-shell password

Follow the prompts to reset the password.

reset root user password

Reboot OPNsense

You can reboot the system and log in with new password.

/sbin/reboot

And Voila!! This is how simple it is to reset or recover root password on OPNsense.

SUPPORT US VIA A VIRTUAL CUP OF COFFEE

We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
koromicha
I am the Co-founder of Kifarunix.com, Linux and the whole FOSS enthusiast, Linux System Admin and a Blue Teamer who loves to share technological tips and hacks with others as a way of sharing knowledge as: "In vain have you acquired knowledge if you have not imparted it to others".

5 thoughts on “How To Reset Or Recover Root Password On OPNsense”

Leave a Comment