Ad Widget

Collapse

Lost MFA on SuperAdmin account, how to reset via CLI?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mechielhengstmengel
    Junior Member
    • Jan 2025
    • 2

    #1

    Lost MFA on SuperAdmin account, how to reset via CLI?

    Hi all

    I am a longtime Zabbix user but I made a mistake... so we have Zabbix running in our private network with AD users without SuperAdmin permissions. The only account with SuperAdmin is the Admin account and as an extra security I added MFA to that account. Now I have a new phone for a while already and restarted the Zabbix server, resulting in ending my browser session and having to authenticate. So I am locked out of my Superadmin account and other accounts don't have SuperAdmin permissions.

    I do have root access to the Linux server but online guidance only shows how to reset password, but not the MFA. Anyone any clever ideas? Help is greatly appreciated.

    Debian 12.8
    Zabbix 7.0.6
  • mechielhengstmengel
    Junior Member
    • Jan 2025
    • 2

    #2
    Oke so I am definitely not an sql administrator nor any program experience, but I managed to solve this issue. If I did anything strange please let me know so I can learn from it :-)

    As you can see here: 12 Resetting password there is a string to reset the admin password. I used a bit of copilot and did the following commands in CLI:

    root@nl-zabbix-01:/home/connect# mysql -u root -p
    Enter password:
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    MariaDB [(none)]> use zabbix
    Database changed
    MariaDB [zabbix]> SELECT * FROM users;
    #Here you can see the users table containing several fields, where one is "roleid". All my users have Users or Admin role and my Admin account has only SuperAdmin role. Roleid 1 = user, Roleid 2 = Admin, Roleid 3 = SuperAdmin and 4 is Guest.
    ​MariaDB [zabbix]> UPDATE users SET roleid = '3' WHERE username = 'justanotheraccount';

    Now 'justanotheraccount' has superadmin role. This account does not have MFA and I am able to login with it, reset the TOTP for the Admin account and we are good to go!

    Comment

    Working...