# Creating password to default users

**URL:** <https://discuss.elastic.co/t/creating-password-to-default-users/272006>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security, docker\
**Created:** [May 3, 2021, 4:54pm UTC](https://discuss.elastic.co/t/creating-password-to-default-users/272006 "2021-05-03T16:54:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antonio\_Marques](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/antonio_marques/32/88196_2.png) [@Antonio\_Marques](https://discuss.elastic.co/u/Antonio_Marques)\
**Post date:** [May 3, 2021, 4:54pm UTC](https://discuss.elastic.co/t/creating-password-to-default-users/272006/1 "2021-05-03T16:54:46Z")

</div>

Hey gurus!

I want to automate the process of my docker installation.  
I don't want to setup an elasticsearch instance to run `docker exec elasticsearch-1 /bin/bash -c "bin/elasticsearch-setup-passwords auto --batch --url https://loaclhost:9200"` after to get, ie, kibana\_system password and then run kibana docker.

How can I use the elasticsearch-setup-passowords in a docker-compose file ? Or maybe I need to use `elasticsearch-keystore create` the` echo $PASS| elasticsearch-keystore add -x username`

Cheers,

Antonio Marques

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [May 4, 2021, 2:41am UTC](https://discuss.elastic.co/t/creating-password-to-default-users/272006/2 "2021-05-04T02:41:16Z")

</div>

Don't use setup-passwords at all.

You don't need it. Just authenticate with your Docker bootstrap password (`ELASTIC_PASSWORD`) and then use the [Change password API](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html) to set permanent passwords for the `elastic` and `kibana_system` users.

---

<div class="post-metadata">

**Author:** ![Antonio\_Marques](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/antonio_marques/32/88196_2.png) [@Antonio\_Marques](https://discuss.elastic.co/u/Antonio_Marques)\
**Post date:** [May 4, 2021, 3:48pm UTC](https://discuss.elastic.co/t/creating-password-to-default-users/272006/3 "2021-05-04T15:48:06Z")

</div>

Thanks @TimV  
I did a search and found some examples here on how to use ELASTIC\_PASSWORD and works!..

The only problem I saw is that all other apps will use elastic as user (kibana and fluentd). For me that's not a big problem because EFK are inside the VPC without a public IP.

How can we workaround this ? I mean user kibana\_system to kibana, a fluent user to fluentd...

Regards,  
Antonio Marques

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 1, 2021, 3:48pm UTC](https://discuss.elastic.co/t/creating-password-to-default-users/272006/4 "2021-06-01T15:48:13Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
