How to disable 2FA / two factor auth

Hello,
i have setup a Nextcloud Test-System.
I copied my Nextcloud Production-System to the Test-System.
I wanted to disable the 2FA feature for the User Admin in Test-System:
I disabled TOTP for admin and set enforce to off.
But 2FA is still active at login, asking me to enter Backupcodes.
sudo -u www-data php /var/www/html/occ twofactorauth:state admin
Two-factor authentication is enabled for user admin
Enabled providers:

  • backup_codes
  • email
    Disabled providers:
  • admin
  • gateway_signal
  • gateway_sms
  • gateway_telegram
  • totp

Backup_codes and email is still enabled.
I cant disable them.
sudo -u www-data php /var/www/html/occ twofactorauth:disable admin email
In ProviderManager.php line 53:
The provider ‘email’ does not exist’
I assume, that because i had the provider “email” active in an older version of my Nextcloud installation, there are some remnants of it, but i can be wrong
I also can not disable the Proviser “backup_codes”.
I tried to install the twofactor_email App, but it is not compatible with me version.
Does someone have an idea?
I can see the twofactor_email App in the folder of apps.
If i delete it, it is still shown as a twofactor provider

Proxmox VE: 6.3
Nextcloud version: 20.0.3
Operating system and version: Debian 10 (LXC)
Apache or nginx version: Apache2
PHP version: 7.3

I what able to solve it. I changed the values directly in the database
Here are my steps:

  • login to mysql
  • use nextclouddb;
  • select * from oc_twofactor_providers
    in the output you can see the columns
    provider_id; uid; enabled
  • update oc_twofactor_providers set enabled = ‘0’ where provider_id = ‘email’ and uid = ‘admin’;
  • select * from oc_twofactor_providers
  • exit;
    thats it, thank you
2 Likes