从MariaDB层面操做管理zabbix帐号异常


1. 查询帐号清单html

# mysql -h127.0.0.1 -uroot -p
mysql> select * from zabbix.users;

 

2. 查询Admin帐号状态mysql

mysql> select name, alias, passwd from zabbix.users where alias='Admin';

 

3. 重置Admin密码
--http://www.geekpills.com/operating-system/linux/how-to-reset-zabbix-admin-password
SQL语句里面直接输入明文密码,DB会自动加密:linux

mysql> update zabbix.users set passwd=md5('NewPassword') where alias='Admin';

 

4. 查询Admin帐号是否被Disabled;sql

mysql> select * from zabbix.users_groups where usrgrpid=9 and userid=1;

 

5. 若是帐号被禁用,即帐号被加入到了Disabled群组里。 这时候能够在DB里面将Admin帐号启用bash

mysql> delete from zabbix.users_groups where userid=1 and usrgrpid=9

6. 直接在DB里面操做, 新增1个本地管理员帐号加密

mysql> insert into users (userid, alias, name, surname, passwd, url, autologin, autologout, lang,refresh,type,theme,attempt_failed,attempt_ip,attempt_clock,rows_per_page) values (61, 'testa', 'testa', 'testa', md5('xxx'),'',1,0,'zh_CN','30s',3,'default',0,'172.16.88.99','1514962814','50');


7. 假如咱们将认证方式配置为LDAP,可是认证使用的帐号被误删除,而且密码已经记不清了,或者LDAP系统挂掉,此时使用Zabbix初安装时的Admin/zabbix 帐号密码组合是不能登录的。这时咱们该怎么办呢?url

思路是(https://www.iyunv.com/thread-18779-1-1.html):
    更改认证类型为Internal,而后使用Admin登录,若是忘记密码,也能够重置Admin密码
    其中,认证类型由 authentication_type,字段决定,值能够为0,1和2。0 表明Internal,1表明LDAP,2表明HTTP.code

mysql> update config set authentication_type=0;
相关文章
相关标签/搜索