Disable Nextcloud 2FA

Hey everyone, just thought id share a solution that I had found. I was messing around with my settings and accidentally enabled 2FA on all my accounts so when I logged out and logged in later that day I couldn’t log in. I did some research and did not really find anything helpful. For more advanced people there might be a different way to solve this but I’m not too sure. if you are locked out of your account because of your 2FA, this is how to disable it. if you’re running on Truenas like I am, you’re going to want to go to your config/config.php file through your Nextcloud jail shell. once you are in your config.php file scroll down till you find your 2FA settings. should be almost at the bottom. Next, just delete all the settings, ill paste the code into here so you know what exactly you need to get rid of. Make sure you dont delete the brackets or the commas as this may lead to more problems.

<?php $CONFIG = array ( 'apps_paths' => array ( 0 => array ( 'path' => '/usr/local/www/nextcloud/apps', 'url' => '/apps', 'writable' => true, ), 1 => array ( 'path' => '/usr/local/www/nextcloud/apps-pkg', 'url' => '/apps-pkg', 'writable' => true, ), ), 'logfile' => '/var/log/nextcloud/nextcloud.log', 'passwordsalt' => '************************', 'secret' => '*******************************************', 'trusted_domains' => array ( 0 => 'localhost', 1 => '192.168.1.89', 2 => '192.168.1.91', ), 'dbtype' => 'mysql', 'version' => '22.1.1.2', 'overwrite.cli.url' => 'http://localhost', 'dbname' => 'nextcloud', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'oc_ncadmin', 'dbpassword' => 'TsjmWEAsQIq4sfYlgGmIRfHJ9NxYfz', 'installed' => true, 'instanceid' => 'ocx53fte2p47', 'app_install_overwrite' => array ( 0 => 'printer', *> ANYTHING IN THIS SECTION CAN BE DELETED* ), ); ![Screenshot (25)_LI|690x388](upload://uUAzBJ5AliVXR5vTrzIycDluarm.jpeg)

Could you put that in a code block so it can be read?