6、ELK安裝之設(shè)置用戶認證

1、在ES的配置文件elasticsearch.yml添加

http.cors.enabled: true

http.cors.allow-origin: "*"

http.cors.allow-headers: Authorization

xpack.security.enabled: true

xpack.security.transport.ssl.enabled: true

2、生成賬號密碼

/bin/elasticsearch-setup-passwords? auto? //自動生成密碼,kibana、logstash、filebeat的密碼自動生成

/bin/elasticsearch-setup-passwords? interactive? //交互式生成密碼,每個密碼自定義

3、在kibana配置文件中添加用戶名和密碼

在kibana.yml文件最后添加

elasticsearch.username: "elastic"? ? //默認賬號,不能修改

elasticsearch.password: "hello12345"? //自定義密碼

4、在logstash輸出中配置用戶名和密碼

output {

? elasticsearch {

? ? hosts => ["127.0.0.1:9200"]

? ? ? ? index => "logstash-nginx"

? ? ? ? workers => 1

? ? ? ? template_overwrite => true

? ? ? ? user => "elastic"

? ? ? ? password => "Oracle1234!"

? }

stdout { codec => rubydebug }

}

https://www.yangxinghui.com/599.html

密碼驗證:

本地 驗證 elastic 賬戶

curl -u elastic 'http://localhost:9200/_xpack/security/_authenticate?pretty'

重置 elastic 賬戶密碼

curl -u elastic -XPUT 'http://localhost:9200/_xpack/security/user/elastic/_password?pretty' -H 'Content-Type: application/json' -d'{"password" : "elastic"}

參考:

https://www.cnblogs.com/sharesdk/p/12938981.html

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容