A lot of the guides for resetting the root password on an OPNSense box assume a UFS root partition. The password recovery steps do not work if you installed OPNSense with a ZFS root partition. If you try to follow the steps you get a lovely error about “unrecognized filesystem”
The process for ZFS (thanks to this article) is instead to run the following commands:
zfs set readonly=off zroot
zfs mount -a
Once that is done, you can proceed with the rest of the steps. Password recovery steps in full:
- Press the number 2 immediately on boot to go into single user mode
- Press enter when prompted for shell
- Make ZFS read/write:
- zfs set readonly=off zroot
- zfs mount -a
- Reset password
- opnsense-shell password
- Reboot
Your fix was the only one that worked for me. Thank you!!!!