How to disable 2FA aka 2 Factor Authentification — CyberPanel - WebHosting Control Panel for OpenLiteSpeed
CyberLoader

How to disable 2FA aka 2 Factor Authentification

Original thanks to @land12 for method in: https://forums.cyberpanel.net/discussion/comment/11902/#Comment_11902

Below is reusable way to do this for the main administrator with an id of 1

How to disable it
PASSWORD=$(cat /etc/cyberpanel/mysqlPassword);
DB_NAME="cyberpanel";
mysql -uroot -p${PASSWORD} "${DB_NAME}" -e "UPDATE loginSystem_administrator SET twoFA = '0' WHERE id = 1;"

How to check if its enabled:
PASSWORD=$(cat /etc/cyberpanel/mysqlPassword);
DB_NAME="cyberpanel";
mysql -uroot -p${PASSWORD} "${DB_NAME}" -e "SELECT twoFA FROM loginSystem_administrator WHERE id = 1;"

Example:
[email protected]:~# PASSWORD=$(cat /etc/cyberpanel/mysqlPassword);
[email protected]:~# DB_NAME="cyberpanel";
ro[email protected]:~# mysql -uroot -p${PASSWORD} "${DB_NAME}" -e "SELECT twoFA FROM loginSystem_administrator WHERE id = 1;"
+-------+
| twoFA |
+-------+
| 0 |
+-------+
[email protected]:~#

Also requested that the official documentation is updated to reflect how to do this as it seems to be coming up alot lately.
https://cyberpanel.net/docs/two-factor-authentication-in-cyberpanel/
Tagged:
Tagged:

Comments

  • Thanks alot, but i have same issue, i check if enabled but I didn’t know what that mean
    +-------+
    | twoFA |
    +-------+
    | 0 |
    +-------+
    I still can’t access our panel
  • como eu encontro o meu id?
  • Why I get Google 2FA activated after I install cyberpanel?
    what SSH command to remove this feature from my server?
  • HELP CENTOS 7 2FA DISABLE CODE SSH
  • its a big problem
    we cannot login to the control panel, we didn't enable 2FA, why its automatically enabled when login?
  • edited April 7
    Type your coI did this:
    Go to the Security Basics page and log in to your Microsoft account.
    Select Advanced Security Settings.
    For the second-step verification, select Set to two-step verification to enable it, or select Disable two-step verification to enable it to disable it .
    https://wallarm.com/
  • Type your comment> @samysalahgad said:
    > its a big problem
    > we cannot login to the control panel, we didn't enable 2FA, why its automatically enabled when login?

    Yes, I also got the same error, I didn't enable Google 2FA but they automatically enabled, and now I can't login dc Panel. Do you have any solution?
  • edited June 8
    One of our clients reports the same issue since today. Above fix in the DB does not work, because twoFA field is already 0:

    MariaDB [cyberpanel]> SELECT twoFA FROM loginSystem_administrator WHERE id = 1
    -> ;
    +-------+
    | twoFA |
    +-------+
    | 0 |
    +-------+
    1 row in set (0.001 sec)

    To be sure and stupid, I ran the script:
    UPDATE `loginSystem_administrator` SET `twoFA` = '0' WHERE `loginSystem_administrator`.`id` = 1;
    Query OK, 0 rows affected (0.001 sec)
    Rows matched: 1 Changed: 0 Warnings: 0

    and after:
    systemctl restart lscpd


    Also did a yum update to make sure I use the most recent versions and changed the admin pass.

    Still the 2FA field....
  • i hope this can help;
    open with new browser (different with your daily browser) and open 8090 in browser
    if it's pop google auth field then delete your browser history (ctrl+shif+del if you use chrome and firefox) and choose everything. close your 8090 page and the re open. the google auth magically disappear .. it's work for me.. not use the DB injection
  • > @bgxerjoe said:
    > i hope this can help;
    > open with new browser (different with your daily browser) and open 8090 in browser
    > if it's pop google auth field then delete your browser history (ctrl+shif+del if you use chrome and firefox) and choose everything. close your 8090 page and the re open. the google auth magically disappear .. it's work for me.. not use the DB injection


    Yes, did it for me! Thank you.
  • Yesterday this error came due to Fastly CDN being down.
  • 1. Go to the Security basics page and sign in with your Microsoft account.
    2. Select More security options.
    3. Under Two-step verification, choose Set up two-step verification to turn it on, or choose
    Turn off two-step verification to turn it off.
    4. Follow the instructions.
  • I used vpn to enter the admin panel, it helped me
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!