Default passwords change in docker image without having dockercompose.yml

#1

Hello , I’m trying to change default password of elasticsearch and kibana
for instance admin:admin or kibanaserver:kibanaserver

i took the image of container from https://hub.docker.com/r/amazon/opendistro-for-elasticsearch
and i didn’t write any docker compose.yml file. i just run the container without .yml file

in
/usr/share/elasticsearch/plugins/opendistro_security/securityconfig
internal_user.yml , i changed default password from here with new hash but i when i restart to container it’s not changing i tried many times but still i get same default password

i follow this page https://opendistro.github.io/for-elasticsearch-docs/docs/install/docker-security/

can someone please help me to figure it out this issue?
Thanks a lot

#2

Hi,

I had the exact same issue. Be sure you didn’t use a mounted volume when you first ran the container as data will be persisted after restart. The security plugin creates a new index in elasticsearch (.opendistro_security). Once you restart this won’t actually be changed as it’s already populated. You can exec into the container and force the service to recreate the index. navigate to:
- /usr/share/elasticsearch/plugins/opendistro_security/tools
And run:
./securityadmin.sh -cd …/securityconfig/ -icl -nhnv -cacert …/…/…/config/root-ca.pem -cert …/…/…/config/kirk.pem -key …/…/…/config/kirk-key.pem

1 Like