# How does one set passwords in a pod with x-pack true

**URL:** <https://discuss.elastic.co/t/how-does-one-set-passwords-in-a-pod-with-x-pack-true/192360>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [July 26, 2019, 5:55am UTC](https://discuss.elastic.co/t/how-does-one-set-passwords-in-a-pod-with-x-pack-true/192360 "2019-07-26T05:55:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soumitra\_Ghosh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/soumitra_ghosh/32/46221_2.png) [@Soumitra\_Ghosh](https://discuss.elastic.co/u/Soumitra_Ghosh)\
**Post date:** [July 26, 2019, 5:55am UTC](https://discuss.elastic.co/t/how-does-one-set-passwords-in-a-pod-with-x-pack-true/192360/1 "2019-07-26T05:55:12Z")

</div>

All the examples are related to running  
bin/elasticsearch-setup-passwords interactive or auto however once elastic pod is started there is no way to shutdown to run these commands. Is there an env variable that can be passed?

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [July 26, 2019, 6:54am UTC](https://discuss.elastic.co/t/how-does-one-set-passwords-in-a-pod-with-x-pack-true/192360/2 "2019-07-26T06:54:35Z")

</div>

I'm not sure exactly what you refer to with `elastic pod` but Elasticsearch should be running for you to run `elasticsearch-setup-passwords` , so there is no need to shut it down.

In any way , you can pass the password for the `elastic` user with the `ELASTIC_PASSWORD` env variable if you wish and then use the [Change Passwords API](https://www.elastic.co/guide/en/elasticsearch/reference/7.2/security-api-change-password.html) to set the password for the rest of the users. See [our docs](https://www.elastic.co/guide/en/elasticsearch/reference/7.2/configuring-tls-docker.html)

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [July 26, 2019, 1:29pm UTC](https://discuss.elastic.co/t/how-does-one-set-passwords-in-a-pod-with-x-pack-true/192360/3 "2019-07-26T13:29:51Z")

</div>

Hi @Soumitra_Ghosh,

As I was thankfully made aware by @joshbressers, you're probably talking about k8s. In that case, and assuming you are using our orchestrator, please take a look at our relevant [documentation](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-quickstart.html), more specifically step 2 under [this section](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-quickstart.html#k8s-request_elasticsearch_access)

---

<div class="post-metadata">

**Author:** ![Soumitra\_Ghosh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/soumitra_ghosh/32/46221_2.png) [@Soumitra\_Ghosh](https://discuss.elastic.co/u/Soumitra_Ghosh)\
**Post date:** [July 26, 2019, 3:35pm UTC](https://discuss.elastic.co/t/how-does-one-set-passwords-in-a-pod-with-x-pack-true/192360/4 "2019-07-26T15:35:53Z")

</div>

Hi thank you. Yes correct its on k8s it is on a cluster I built. This example is for a single node. Will this not work for a multi node elasticsearch cluster on k8s?

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [July 26, 2019, 3:42pm UTC](https://discuss.elastic.co/t/how-does-one-set-passwords-in-a-pod-with-x-pack-true/192360/5 "2019-07-26T15:42:27Z")

</div>

I don't see why it won't

---

<div class="post-metadata">

**Author:** ![Soumitra\_Ghosh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/soumitra_ghosh/32/46221_2.png) [@Soumitra\_Ghosh](https://discuss.elastic.co/u/Soumitra_Ghosh)\
**Post date:** [July 26, 2019, 4:58pm UTC](https://discuss.elastic.co/t/how-does-one-set-passwords-in-a-pod-with-x-pack-true/192360/6 "2019-07-26T16:58:03Z")

</div>

Hi so you had originally said we could pass this through the env variable would that not work? I tried to seed it through yaml file but it does not take that value.  
- name: elasticsearch.user  
value: "elastic"  
- name: elasticsearch.password  
value: "changeme"

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [July 26, 2019, 5:26pm UTC](https://discuss.elastic.co/t/how-does-one-set-passwords-in-a-pod-with-x-pack-true/192360/7 "2019-07-26T17:26:44Z")

</div>

My assumption for suggesting that previously, was that you use our docker image so I just mentioned [what our docs say](https://www.elastic.co/guide/en/elasticsearch/reference/7.2/configuring-tls-docker.html).

Since you are on k8s, please follow the relevant docs and the suggestions in there.

---

<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:** [August 23, 2019, 5:26pm UTC](https://discuss.elastic.co/t/how-does-one-set-passwords-in-a-pod-with-x-pack-true/192360/8 "2019-08-23T17:26:45Z")

</div>

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