Skip to content

Instantly share code, notes, and snippets.

@eliroca
Last active September 20, 2021 17:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliroca/bdfff89b5ba247db8072db9e93e1c882 to your computer and use it in GitHub Desktop.
Save eliroca/bdfff89b5ba247db8072db9e93e1c882 to your computer and use it in GitHub Desktop.
Disable Enforce Two-factor Authentication (2FA) Setting on NextCloudPi

Using the occ command to disable Two-factor Authentication on NCP v1.10.0, NC v15.0.5

Nextcloud’s occ command (origins from “ownCloud Console”) is Nextcloud’s command-line interface. You can perform many common server operations with occ, such as installing and upgrading Nextcloud, manage users, encryption, passwords, LDAP setting, and more.

occ is in the nextcloud/ directory; for example /var/www/nextcloud on Raspbian. occ is a PHP script. You must run it as your HTTP user to ensure that the correct permissions are maintained on your Nextcloud files and directories.

1. ssh into your RPi

$> ssh $user@raspberrypi

2. Turn 2FA enforce OFF

$> sudo -u www-data php /var/www/nextcloud/occ twofactorauth:enforce --off

That's it! Don't forget to save your backup codes next time :)
Extras:
3. Update all apps

$> sudo -u www-data php /var/www/nextcloud/occ app:update --all

4. Install and enable twofactor_totp

$> sudo -u www-data php /var/www/nextcloud/occ app:install twofactor_totp $> sudo -u www-data php /var/www/nextcloud/occ app:enable twofactor_totp

Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment