How to Use occ on Command Line to Disable Two-Factor Authentication and Get Logged In

Please help us by providing the following info. Before posting please also check the pinned "Known issues" threads and make sure that you're running the latest available version for your oC release: https://owncloud.org/changelog/

Steps to reproduce
1. Enable two-factor authentication and can't set it up in admin area because of email issue
2. Log out and attempt to log back in
3. Receiving request for two-factor authentication that I forgot to disable but is not set up

Expected behaviour
Tell us what should happen

I thought I should be able to log back in and bypass two-factor authentication since Admin account isn't set up for it.

Actual behaviour
Tell us what happens instead

I enter Admin and password and get the two-factor authentication screen and have to cancel login.

Server configuration
Operating system: Centos 7.2
Web server: Apache
Database: MySQL
PHP version: 5.6
ownCloud version (see ownCloud admin page): 9.1
Updated from an older ownCloud or fresh install: Fresh Install
Special configuration (external storage, external authentication, reverse proxy, server-side-encryption): Two-Factor Authentication

ownCloud log (data/owncloud.log)

Please paste possible errors in the following code block, see https://central.owncloud.org/t/how-to-find-webserver-or-oc-logfile-enable-php-logfile/808 for more info (Can't log in to see these errors)

Integrity status for oC9+

Login as admin user into your ownCloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here. (Can't log in to see these errors

Hi Yksityinen.

Try running via occ twofactorauth:disable

e.g.

sudo -u www-data ./occ twofactorauth:disable

If that command does not solve your problem, do not hesitate to write back here again.

Cheers,

David

1 Like

The easy way is to uninstall it from your owncloud.
If you can’t login to admin account. you can find the verify code from the oc_twofactor_backup_codes table in your owncloud database then you can login to admin account to uninstall it.