2 Factor Auth muck up [Unsolved]

Hi guys Noob here is the Admin on my raspi nextcloud and while setting it up i have activated 2factor on both my admin acount and my personal account also a admin but have not scanned anything with my phone so have no access back into nextcloud to switch it off or set up correctly.

Is there away of doing it via the command line or getting in to do it. I have already tried a password reset hoping that would disable it.

Thank you in advance. Like i said Noob so please try to keep it simple.

Login via command line.

Run the following command inside your nextcloud folder (e.g. /var/www/nextcloud)

./occ twofactorauth:disable username

Replacing username with yours/admin username

You may need to run this as the http user (e.g. for nginx) it would be nginx or www-data and also call the PHP command as it’s a PHP script, so it would be

su - nginx php ./occ twofactorauth:disable username

If you’re not th root user, you may need to add sudo to th front of the command


Hi Tom,
Thank you for your response and offer of help unfortunatly im hitting a snag. im logged in as root on my raspi and getting the following when trying your method. Any ideas.