Two-factor authentication

Hello, everybody,
after updating the nextcloud version I have a problem with the website registration.
After entering my access data I get this message:

two-factor authentication

**Couldn’t load one of your two-factor authentication methods. Contact your administrator **
**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.

Unfortunately I don’t have a working backup code :roll:
But I still have ssh access and wanted to ask if there is the possibility to activate the appropriate apps or to create a backup code via the console.
I found a command on the net that should create a code.

sudo -u www-data php occ twofactorauth:admin:generate-code Username
But I always get this message:

There are no commands defined in the “twofactorauth:admin” namespace.
Can anyone help me here ?

If you’re the administrator why do you not disable 2FA on the console, login with your account, create backup codes and re-enable 2FA afterwards?


I’d like to do that, but unfortunately I don’t know how it works and wanted to ask if anyone could help me with the matter.

./occ twofactorauth:disable username

I can’t.
It comes then:
-bash: ./occ: No authorization

I would expect that ./occ twofactorauth:state shows the current 2fa state and
./occ twofactorauth:cleanup allows to do some 2fa cleanup etc., but I must admit
that I weren’t in a situation yet to use this commands. See

sudo -u www-data php occ app:update --all