os: centos 7.6
db: postgres 12.7
zabbix: 5.0 LTS

登录 zabbix web 时,用户 Admin 忘记密码。

处理过程如下

# su - postgres
$ psql

postgres=# \l
                                    List of databases
    Name     |    Owner    | Encoding |   Collate   |    Ctype    |   Access privileges   
-------------+-------------+----------+-------------+-------------+-----------------------
 postgres    | postgres    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0   | postgres    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
             |             |          |             |             | postgres=CTc/postgres
 template1   | postgres    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
             |             |          |             |             | postgres=CTc/postgres
 zabbix      | zabbix      | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 zabbixproxy | zabbixproxy | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
(5 rows)

postgres=# \c zabbix

zabbix=# select * from users;
 userid | alias |  name  |    surname    |                            passwd                            | url | autologin | autologout | lang  | refresh | type |  theme  | attempt_failed |  attempt_ip  | attempt_clock | rows_per_page 
--------+-------+--------+---------------+--------------------------------------------------------------+-----+-----------+------------+-------+---------+------+---------+----------------+--------------+---------------+---------------
      2 | guest |        |               | $2y$10$89otZrRNmde97rIyzclecuk6LwKAsHN0BcvoOKGjbT.BwMBfm7G06 |     |         0 | 15m        | en_GB | 30s     |    1 | default |              0 |              |             0 |            50
      1 | Admin | Zabbix | Administrator | $2y$10$ifJozib7SEXAesUMV8t1yOeJSD3.wbli.jOKdQCabGeHEMvr5zIvy |     |         1 | 0          | zh_CN | 30s     |    3 | default |              5 | 192.168.56.1 |    1626339508 |            50
(2 rows)

自定义密码

# htpasswd -bnBC 10 "" AdminAdmin | tr -d ':'
$2y$10$Z/eJ5knsvvsLXUouE7OX/ep.huywRPOyXv2KAuxxk9hCOUNJ2a9z6

zabbix=# update users set passwd='$2y$10$Z/eJ5knsvvsLXUouE7OX/ep.huywRPOyXv2KAuxxk9hCOUNJ2a9z6' where userid=1;

还原成初始化密码

从 create.sql.gz 找到出示化时的密码

INSERT INTO users (userid,alias,name,surname,passwd,url,autologin,autologout,lang,refresh,type,theme,rows_per_page) values ('1','Admin','Zabbix','Administrator','$2y$10$92nDno4n0Zm7Ej7Jfsz8WukBfgSS/U0QkIuu8WkJPihXBb2A1UrEK','','1','0','en_GB','30s','3','default','50');
INSERT INTO users (userid,alias,name,surname,passwd,url,autologin,autologout,lang,refresh,type,theme,rows_per_page) values ('2','guest','','','$2y$10$89otZrRNmde97rIyzclecuk6LwKAsHN0BcvoOKGjbT.BwMBfm7G06','','0','15m','en_GB','30s','1','default','50');

zabbix=# update users set passwd='$2y$10$92nDno4n0Zm7Ej7Jfsz8WukBfgSS/U0QkIuu8WkJPihXBb2A1UrEK' where userid=1;

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐