mysql When switching to zabbix 6.2.2, how do we have to change password setting?

ql3eal8s  于 2022-12-22  发布在  Mysql
关注(0)|答案(2)|浏览(151)

Additional info

Now using zabbix 6.2.2 I noticed that /usr/share/doc/zabbix-server-mysql/create.sql.gz no longer exists. After some googling I found zabbix-sql-scripts . Unsure what to import from the new folder /usr/share/doc/zabbix-sql-scripts I picked ./mysql/server.sql.gz because we use MariaDB . This indeed set up the database zabbix.users.

Actual question

However: In the old zabbix version we ran update users set passwd=md5('PASSWORD') where alias='Admin' on zabbix.users . Alias doesn't exist anymore so I switched to update users set passwd=md5('PASSWORD') where username='Admin' . That seemed to do the trick, but didn't. While the command runs without error, the password is not correctly set.
Even though I set login_user: Admin and login_password: PASSWORD ansible fails to connect. This does not happen if the password is not set and standard "zabbix" is used.
Why is setting the password no longer working?
I am still very new to zabbix, but the project worked before on an older zabbix version just importing aforementioned create.sql.gz .

j5fpnvbx

j5fpnvbx1#

Since 5.0 Zabbix switched from md5 hashing algorithm to bcrypt: https://support.zabbix.com/browse/ZBXNEXT-1898 Since then, on the first log in after upgrade all md5 hashes are converted to bcrypt by Frontend automatically.
https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/410430-reset-admin-password-for-zabbix-lts-5-0
Therefore I needed to use bcrypt instead of md5 which I did using the inbuilt ansible command password_hash combined with passlib : How escape random string for linux shell to update mysql datase entry using ansible?

3df52oht

3df52oht2#

In Zabbix 6.2, md5 is not used anymore and field "alias" was renamed in "surname" so to solve this, please use the following MySQL command:

UPDATE zabbix.users AS a INNER JOIN zabbix.users AS b ON b.username='guest' SET a.passwd = b.passwd;

This will set the Admin password same as Guest (without password) Then you can log in into the Zabbix web interface as Admin (without password) Please do not forget to change your password on first log in.
Thanks

相关问题