ELK用户管理

来源:互联网 发布:阶乘java递归方法 编辑:程序博客网 时间:2024/06/04 20:07

1、 添加用户

# cd /data/PRG/elasticsearch# bin/x-pack/users useradd admin -p kbsonlong -r superuser

2、查看用户

[root@kbsonlong elasticsearch]# bin/x-pack/users listkbson          : monitoring_useradmin          : superuser[root@kbsonlong elasticsearch]#

3、测试用户是否成功登录

[root@kbsonlong elasticsearch]# GET http://localhost:9200/_xpack/Enter username for security at localhost:9200: adminPassword: {"build":{"hash":"e006fe8","date":"2016-11-24T10:19:32.318Z"},"license":{"uid":"f95af1d7-92a1-441b-8241-e0552c734b85","type":"trial","mode":"trial","status":"active","expiry_date_in_millis":1483743352122},"features":{"graph":{"description":"Graph Data Exploration for the Elastic Stack","available":true,"enabled":true},"monitoring":{"description":"Monitoring for the Elastic Stack","available":true,"enabled":true},"security":{"description":"Security for the Elastic Stack","available":true,"enabled":true},"watcher":{"description":"Alerting, Notification and Automation for the Elastic Stack","available":true,"enabled":true}},"tagline":"You know, for X"}

# curl http://localhost:9200/_xpack/ --user admin:kbsonlong{"build":{"hash":"7763f8e","date":"2016-10-26T04:51:59.202Z"},"license":{"uid":"06a82587-66ac-4d4a-90c4-857d9ca7f3bc","type":"trial","mode":"trial","status":"active","expiry_date_in_millis":1483753731066},"features":{"graph":{"description":"Graph Data Exploration for the Elastic Stack","available":true,"enabled":true},"monitoring":{"description":"Monitoring for the Elastic Stack","available":true,"enabled":true},"security":{"description":"Security for the Elastic Stack","available":true,"enabled":true},"watcher":{"description":"Alerting, Notification and Automation for the Elastic Stack","available":true,"enabled":true}},"tagline":"You know, for X"}


4、删除用户

# /data/PRG/elasticsearch/bin/x-pack/users userdel kbson # /data/PRG/elasticsearch/bin/x-pack/users listadmin          :superuser




0 0
原创粉丝点击