Admin Two-Factor Authentication Backup Code Forgotten

Hello dear community,

I have a problem. Today I set up my nextCloud and wanted to activate a two-factor authentication directly.
I logged in as admin and activated the two-factor authentication. As I thought that you have to configure the two-factor authentication first, I logged out directly. Of course, I did not save the backup code.

Is there a way to get the backup code again? Or is there a way to bypass the two-factor authentication?

I still have full access to the server (via command line) but I cannot log into the account.

Two-factor authentication

Two-factor authentication is enforced but has not been configured for your account. Use one of your backup codes to log in, or contact your administrator for assistance.

Use backup code

Cancel login

You can deactivate 2fa on the console.

Show Configuration:

php ./occ twofactorauth:state <user>

Disable 2FA:

php ./occ twofactorauth:disable <user> <provider>
1 Like