2FA locked out no access to console

I used the google authenticator to generate codes for 2FA, but I just reset my phone and didn’t back up those codes, so I’m locked out. However, the only solutions I found were using “occ” on the server. The problem is, I don’t think I have access to that. I installed nextcloud on my webspace (cheapest hosting with OVH) and there is no console option, only FTP.

Can I somehow deactivate 2FA in the config or is there another way?

I’m not aware about an interface to disable 2FA without having root access. You can contact the support of your hoster and ask them to disable 2FA on the console for you.
You could also try to rename the 2FA app folder and hope that it allows to login afterwards again (untested).

that’s too bad. can I reinstall nextcloud without having to upload the files in the cloud again?

Do you have access to the database?

yes I do …

drop the entry from oc_twofactor_totp_secrets that corresponds to your user and the entry in oc_twofactor_providers that belongs to your user and provider_id totp.

2 Likes

that helped, but only after I set ‘twofactor_enforced’ => ‘false’ in config.php