Locked out by 2FA

My server was shutdown by a power outage, and now I’m trying to make sure everything is up and running all right, but clearly not since it seems typing in my 2FA code no longer works so I’m entirely locked out :frowning: help!

Can I delete the 2FA app and login as usual without it? I don’t want to totally screw things up

Update server time with ntp?

I think my server is about 30-40 minutes behind, even after trying these commands:

sudo service ntp stop
sudo ntpd -s time.nist.gov
sudo service ntp start

Still seems off. Is there a better way?

EDIT: Meant minutes, not seconds

It was definitely the time that messed up 2FA. Thank you! I’m going to keep an eye on my server time because nothing would fix it until I ran this:

sntp -s 0.pool.ntp.org

We will see if this holds all right

In case that happens again to someone and you have access to the command line on your server, there’s an occ command to disable 2fa for a given user: https://docs.nextcloud.com/server/10/admin_manual/configuration_server/occ_command.html#two-factor-auth-label

1 Like