For those who have been locked out Cyberpanel due to two factor aunthentication, I have tried all methods on this forum but none worked for me when i lost my Google aunthenticator app. I hope my method works for you. Don’t get locked out of your server. Cheers!
1. Firstly, try connecting through SSH and entering the MySQL command line with these commands.
MYSQL_PWD=`cat /etc/cyberpanel/mysqlPassword` mysql -uroot
2. In order to enter the CyberPanel database, use the command:
use cyberpanel;
3. Now disable 2FA for the admin account with the following command:
UPDATE `loginSystem_administrator` SET `twoFA` = '0' WHERE `loginSystem_administrator`.`id` = 1;
[root@test ~]# MYSQL_PWD=`cat /etc/cyberpanel/mysqlPassword` mysql -uroot Welcome to the MariaDB monitor. Commands end with ; or g. Your MariaDB connection id is 4526 Server version: 10.5.7-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab, and others. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. MariaDB [(none)]> use cyberpanel; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed MariaDB [cyberpanel]> 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 MariaDB [cyberpanel]>