How do i disable google 2 factor authentication or other 2factor mechanisms?

HOW TO RESET GOOGLE 2FA IF USER HAS ACCESS TO THE GUI AND HAVE ADMIN PRIVILEGES

If you already an account with admin privileges, you can reset them via the GUI itself.Login as the admin user, navigate to the user list, select the user that had accidentally set Google 2FA, click on the password icon for the user, and select 'clear 2factor authentication secret box'

   

  

 

   
The user can now login without 2FA being asked if 2FA is not enforced else the user would be prompted to re-setup 2FA again.

 

HOW CAN A USER RESET GOOGLE 2FA IN GUI ?

 

Individual users can login into the web interface and go to Account->Google Authenticator->set 

To reset it you can do by Account->Google Authenticator->reset

  

   

How to disable two factor authentication ( 2FA ) for the admin user and others FROM THE DATABASE? 

For Ezeelogin Version 7 and above

 

1. To disable two factor authentication ( 2FA ) for admin user, run the following commands.

[email protected]:~# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_settings SET value = 0 WHERE name = 'two_factor_auth'"

 

[email protected]:~# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_users set egs=NULL,eak=NULL,eyk=NULL,set_duo=0 where id=1"

 

2. To disable  two factor authentication ( 2FA ) for all users ,run the following command.

[email protected]:~# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_users set egs=NULL,eak=NULL,eyk=NULL,set_duo=0" 

Abbreviations:
   eak       = Access Keyword
   eyk       = Yubikey
   egs       = Google Authenticator
   set_duo = DUO 2FA     

 

For Ezeelogin Version 6 and below 

1. Find database name and database prefix from /usr/local/etc/ezlogin/ez.conf in ezeelogin gateway server.

[email protected]:~# cat /usr/local/etc/ezlogin/ez.conf

system_folder /var/www/ezlogin/

force_https yes

uri_path /

db_host localhost

db_port /var/run/mysqld/mysqld.sock

db_name ezlogin_por

db_user ezlogin_cxy

db_pass ymhbtPaY)VzD2g]84

db_prefix casmbn_

cookie_encryption_key D8$Frp5fF_FF

cookie_name rlbup

cookie_path /

www_folder /var/www/html/ezlogin/

admin_user ezadmin

mysql_encrypt no

 


2. Login to mysql command prompt

 

Replace the "db_user" &  "dn_name" with values in  /usr/local/etc/ezlogin/ez.conf of your ezeelogin jump server.You can find the db password as "db_pass" in /usr/local/etc/ezlogin/ez.conf of your ezeelogin jump server.

[email protected]:~# mysql -u db_user -p db_name

 

4. Run the following command to  two factor authentication ( 2FA ) for admin user

Replace "dbprefix_" with the value of dbprefix_ in  /usr/local/etc/ezlogin/ez.conf of your ezeelogin jump server. For example "dbprefix_settings" is to be replaced with "casmbn_settings" here.

UPDATE dbprefix_settings SET value = 0 WHERE name = 'two_factor_auth' ;

UPDATE dbprefix_users SET egs=NULL,eak=NULL,eyk=NULL,set_duo=0 where id=1;

 


Run the following command two factor authentication ( 2FA ) for all users.

UPDATE dbprefix_users SET egs=NULL,eak=NULL,eyk=NULL,set_duo=0;

 

 

 you have to use correct db_name and dbprefix from ez.conf if you are running the mysql commands manually.

 

 

5 (1)
Article Rating (1 Votes)
Rate this article
    Attached Files
    There are no attachments for this article.
    Related Articles RSS Feed
    Configuration and error log files to check for troubleshooting
    Viewed 3801 times since Thu, Jun 15, 2017
    User add failed
    Viewed 2245 times since Wed, Jun 14, 2017
    Cannot login to ezeelogin backend - CageFS-Cloudlinux
    Viewed 1714 times since Wed, Jun 14, 2017
    ’Failed to establish SSH session ’
    Viewed 1429 times since Fri, Jun 22, 2018
    Error opening terminal: xterm-256color.
    Viewed 204 times since Wed, Jul 31, 2019
    Could not setup Ezeelogin Web SSH service in ssh jumphost
    Viewed 827 times since Fri, Feb 16, 2018
    main admin user account suspended after entering incorrect security code
    Viewed 2126 times since Wed, Jun 14, 2017
    Google 2 factor authentication fails randomly
    Viewed 1541 times since Wed, Jun 14, 2017
    reCaptcha: Could not open socket Connection timed out
    Viewed 3032 times since Wed, Jun 14, 2017
    Configure Automatic su or sudo
    Viewed 3219 times since Thu, Jun 15, 2017