For disabling 2FA by OCC , I did below steps and everything is ok and back to Normal
I use Ubuntu 20.04 LTSC with Nextcloud 22.0
1- first we need to have SSH access logion to Sever
2- find nextcloud configuration file for instance (/var/www/nextcloud/config/config.php)
3- edit config.php and try to find line -
{ ‘twofactor_enforced’ => ‘true’, } change it to { ‘twofactor_enforced’ => ‘false’, }
4- remove below lines from config.php file as well
{ ‘twofactor_enforced_groups’ =>
array (
0 => ‘admin’,
),
‘twofactor_enforced_excluded_groups’ =>
array (
), }
5- save it
6 - it’s Done!
7- reboot the server every thing back to normal stage and 2FA is gone!!