Mitigating Nextcloud Two Factor Authentication Error



  • I upgraded Nextcloud and for some reason two-factor authentication activated on my admin account. Since I couldn't access my admin account I needed to find a way via cli to disable two factor authentication, but because it wasn't configured there was no folder in /var/www/html/nextcloud/apps for me to rename, etc. Below is the command I found that worked for me.

    sudo -u apache php occ config:system:set twofactor_enforced --value=false

    Note: You have to run the command as apache, or if you're using Debian www-data.



  • @wirestyle22 said in Mitigating Nextcloud Two Factor Authentication Error:

    I upgraded Nextcloud and for some reason two-factor authentication activated on my admin account. Since I couldn't access my admin account I needed to find a way via cli to disable two factor authentication, but because it wasn't configured there was no folder in /var/www/html/nextcloud/apps for me to rename, etc. Below is the command I found that worked for me.

    sudo -u apache php occ config:system:set twofactor_enforced --value=false

    Note: You have to run the command as apache, or if you're using Debian www-data.

    You also need to be in the right folder

    By default on Fedora

    cd /var/www/html/nextcloud
    

    Or

    sudo -u apache php /var/www/html/nextcloud/occ config:system:set twofactor_enforced --value=false