Elasticsearch 7.8 开启用户名密码认证

最近工作中安装了es7.8. 我只是安装使用了。并没有设置密码。结果安全扫描到了。需要设置密码。
so。找到了这篇https://www.chengxulvtu.com/elasticsearch-7-8-enable-password-authentication/
下面也记录下。

1.在 elasticsearch.yml 中添加如下配置

# 配置X-Pack
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true

2.重启 elasticsearch 服务

systemctl restart elasticsearch

3.设置密码

./usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive

需要设置 elastic,apm_system,kibana,kibana_system,logstash_system,beats_system,remote_monitoring_user 这些用户的密码

设置完就可以了。用户名是:elastic

好了 玩的开心!

posted @ 2020-09-04 09:58  Kevin_zheng  阅读(5688)  评论(0编辑  收藏  举报