OPNsense Forum

English Forums => General Discussion => Topic started by: jim2cpu on March 16, 2021, 09:21:44 PM

Title: 2FA Oopsie
Post by: jim2cpu on March 16, 2021, 09:21:44 PM
Hi folks. I haven't seen many articles on performing a 2FA recovery, so I thought I would start a clean, current thread.

I got frustrated with my iPhone today and decided to wipe it and "start fresh". Yeahhhh, forgot my 2FA apps. I've been able to recover everything with the exception of OPNsense. I had disabled ssh access and the root account "for security reasons" and I'm thinking at this point I may have to reboot the machine into single user mode and either reset the root password or change some configuration file to restore access to the Web GUI?

Appreciate any insights. Cheers.
Title: Re: 2FA Oopsie
Post by: jim2cpu on March 16, 2021, 11:21:50 PM
I followed the high level guidance provided by franco in this thread:

https://forum.opnsense.org/index.php?topic=15875.0

Worked perfectly. Very simply:

- Boot OPNsense to Single-User Mode
- Mount the / with "mount -o rw /"
- Run "/usr/local/sbin/opnsense-shell password"

It will ask you if you want to reset the root password and also the authentication method... it will shut off the TOPT server and flip you back to local database.

Then "/sbin/reboot" and you should be good to go.

Cheers!
Title: Re: 2FA Oopsie
Post by: space_cadet on March 25, 2024, 08:24:05 PM
Quote from: jim2cpu on March 16, 2021, 11:21:50 PM
I followed the high level guidance provided by franco in this thread:

https://forum.opnsense.org/index.php?topic=15875.0

Worked perfectly. Very simply:

- Boot OPNsense to Single-User Mode
- Mount the / with "mount -o rw /"
- Run "/usr/local/sbin/opnsense-shell password"

It will ask you if you want to reset the root password and also the authentication method... it will shut off the TOPT server and flip you back to local database.

Then "/sbin/reboot" and you should be good to go.

Cheers!

Thank you, jim2cpu! This helped me login again. Had to follow the steps for ZFS (https://docs.opnsense.org/troubleshooting/password_reset.html).

The first question was, do you want to change Authentication to Local Database!  ;D
Still had to reset the root password, but who cares. I was able to login after the reboot.