当前位置:   article > 正文

ElasticSearch设置用户名密码访问_elasticsearch.yml 密码

elasticsearch.yml 密码

版本号:7.3.1

1、需要在配置文件中开启x-pack验证, 修改config目录下面的elasticsearch.yml文件,在里面添加如下内容,并重启
  1. xpack.security.enabled: true
  2. xpack.license.self_generated.type: basic
  3. xpack.security.transport.ssl.enabled: true
2、执行设置用户名和密码的命令,这里需要为4个用户分别设置密码,elastic, kibana, logstash_system,beats_system
bin/elasticsearch-setup-passwords interactive
  1. Initiating the setup of passwords for reserved users elastic,kibana,logstash_system,beats_system.
  2. You will be prompted to enter passwords as the process progresses.
  3. Please confirm that you would like to continue [y/N]y
  4. Enter password for [elastic]:
  5. passwords must be at least [6] characters long
  6. Try again.
  7. Enter password for [elastic]:
  8. Reenter password for [elastic]:
  9. Passwords do not match.
  10. Try again.
  11. Enter password for [elastic]:
  12. Reenter password for [elastic]:
  13. Enter password for [kibana]:
  14. Reenter password for [kibana]:
  15. Enter password for [logstash_system]:
  16. Reenter password for [logstash_system]:
  17. Enter password for [beats_system]:
  18. Reenter password for [beats_system]:
  19. Changed password for user [kibana]
  20. Changed password for user [logstash_system]
  21. Changed password for user [beats_system]
  22. Changed password for user [elastic]
3、修改密码命令如下
curl -H "Content-Type:application/json" -XPOST -u elastic 'http://127.0.0.1:9200/_xpack/security/user/elastic/_password' -d '{ "password" : "123456" }'
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/682184
推荐阅读
相关标签
  

闽ICP备14008679号