Generate Bcrypt Password for Zabbix’s User

Reset password the Zabbix’s users or for the admin itself if you lost their password.

Would be easy this command can be reach from alias, place them on the shell you’re currently use.

alias bcryptgen='python3 -c "import bcrypt, sys; print(bcrypt.hashpw(sys.argv[1].encode(), bcrypt.gensalt()).decode())"'

It requires python3 , couldnt know if this support python2, feel free to test.

Generate password, my example password as such.

➜ ~ bcryptgen this_is_password
$2b$12$.kVZI4UNnNGQnBndL436TuYH8WsDkeW7RDDPiLR8ZWUqy9pKA6fVa
➜ ~

To reset the user’s password from database end, in this case Im using PostgreSQL.

Get to database end;

postgres=# \c zabbix;
You are now connected to database "zabbix" as user "zabbix".
zabbix=# UPDATE users SET passwd = '$2b$12$.kVZI4UNnNGQnBndL436TuYH8WsDkeW7RDDPiLR8ZWUqy9pKA6fVa' WHERE username = 'admin';
UPDATE 1
zabbix=#

Leave a Comment