TOTP (Authenticator app) lost codes for admin login / Only FTP & Database access

Nextcloud version (eg, 20.0.5): 20.0.5
Operating system and version (eg, Ubuntu 20.04): shared webhosting at
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 7.4): PHP 7.4

The issue you are facing:

I am running mit nextcloud with TOTP 2FA App.
My phone crashed and i have no access to the 2FA codes.

I can’t login as admin user. I know the password but don’t have the TOTP codes:

As i am using all-inkl shared webhosting i have no SSH and other possibilities.
I only have FTP and database access.

Is there a workaround to login without the codes? Or to manually uninstall/deactivate the TOTP App?

Thanks for your ideas in advance

I see two ways to go:

  1. Use the backup codes which you’ve created as you enabled 2FA.
  2. Ask the support of your hoster or use a cronjob to disable 2FA using the occ command.

Thanks @j-ed for your fast reply. Unfortunately i can’t find the backup codes.

But I can add cronjobs myself in the backend. I never did that before, what to put in the cronjob?

Change db read
How to disable 2FA / two factor auth

or copy the disable-occ-2fa in a cron command.

1 Like

thanks, that solved the problem @devnull

1 Like