[英]Open Distro for Elasticsearch: reset default admin password
我是為 elasticsearch 打開發行版並嘗試在 Kubernetes 集群上運行它的新手。 部署集群后,我需要更改admin
用戶的密碼。
我瀏覽了這篇文章- 默認密碼重置
我知道,要更改密碼,我需要執行以下步驟:
exec
一個主節點中執行/usr/share/elasticsearch/plugins/opendistro_security/tools/hash.sh
腳本為新密碼生成 hash/usr/share/elasticsearch/plugins/opendistro_security/securityconfig/internal_users.yml
/usr/share/elasticsearch/plugins/opendistro_security/tools/securityadmin.sh
問題:
env
或elasticsearch.yml
)?我必須使用更新的密碼哈希重新創建internal_users.yml
文件,並將該文件安裝在數據庫 pod 的/usr/share/elasticsearch/plugins/opendistro_security/securityconfig/internal_users.yml
目錄中。
因此,當 Elasticsearch 節點引導時,它使用默認用戶(即admin
)的更新密碼引導。
我使用bcrypt go package生成密碼 hash。
docker exec -ti ELASTIC_MASTER bash
/usr/share/elasticsearch/plugins/opendistro_security/tools/hash.sh
##輸入密碼
百勝安裝納米
#用新的 nano /usr/share/elasticsearch/plugins/opendistro_security/securityconfig/internal_users.yml 替換生成的 hash
#執行此命令 sh /usr/share/elasticsearch/plugins/opendistro_security/tools/securityadmin.sh -cd /usr/share/elasticsearch/plugins/opendistro_security/securityconfig/ -icl -nhnv -cacert config/root-ca .pem -cert config/admin.pem -key config/admin-key.pem
您還可以執行以下命令從您的 kubernetes 集群獲取用戶名、密碼的值:
kubectl get secret -n wazuh elastic-cred -o go-template='{{.data.username | base64decode}}'
kubectl get secret -n wazuh elastic-cred -o go-template='{{.data.password | base64decode}}'
注意:'-n wazuh' 表示命名空間,使用適合你的
參考: https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-elasticsearch.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.