Change password in OpenSearch 2.x and docker

I noticed there has been a lot of discussion on github to introduce an easier method to change the default admin:admin password when using the quick docker deploy. Has this been addressed in 2.x?

I would love to use this for a quick setup in my dev / lab environment, but would like some minimal security in changing the default password. This is one of the few issues that is keeping me from moving from ES to OS. I would really like to switch over after finding incompatibility issues with ES with their changes to the code to look for particular headers or identifiers that break using some of my code and other third party add-ons.

Having a semi secure quick setup to test code in a development environment would be great!

@greengeek The most straight forward way currently would be map the new internal_users.yml file into containers at start up.

You would need to first use the “hash.sh” tool to hash the needed password and add replace it for admin used in internal_users.yml. Ensure to place the file in the same directory as docker-compose.yml

Then map it in dc.yml as below:

volumes:
      - opensearch-data1:/usr/share/opensearch/data
      - ./internal_users.yml:/usr/share/opensearch/config/opensearch-security/internal_users.yml

This will of course overwrite all the users and passwords.

Hope this helps