# Change Elasticsearch password

**URL:** https://discuss.elastic.co/t/change-elasticsearch-password/381983
**Category:** Elasticsearch
**Created:** [September 16, 2025, 1:40pm UTC](https://discuss.elastic.co/t/change-elasticsearch-password/381983 "2025-09-16T13:40:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![juancamiloll](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juancamiloll/32/110326_2.png) [@juancamiloll](https://discuss.elastic.co/u/juancamiloll)
#### Post date: [September 16, 2025, 1:40pm UTC](https://discuss.elastic.co/t/change-elasticsearch-password/381983/1 "2025-09-16T13:40:21Z")

</div>

Hi

Understanding that Logstash uses .conf files to authenticate against Elasticsearch, I am here today to ask for your help in changing the current password I have configured in the .conf files from Logstash.

```auto
elasticsearch {
  id => "My_font"
  hosts => ["https://192.168.1.1:9200","https://192.168.1.2:9200","https://192.168.1.3:9200"]
  data_stream => true
  data_stream_type => "logs"
  data_stream_dataset => "my_font"
  data_stream_namespace => "prd"
  user => "elastic"
  password => "cocacola"
  ssl_enabled => true
  ssl_certificate_authorities => "/xxxxxxxxxxx/ca.crt"
}

```

If I want to set the new password as **pepsi2025** , how can I do this without affecting the ELK solution?

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [September 16, 2025, 1:57pm UTC](https://discuss.elastic.co/t/change-elasticsearch-password/381983/2 "2025-09-16T13:57:24Z")

</div>

> [@juancamiloll](#):
>
> If I want to set the new password as **pepsi2025** , how can I do this without affecting the ELK solution?

Not sure if I understood, the authentication is done on Elasticsearch side, if you want to change the password for the `elastic` user, you need to do that on Elasticsearch or using the Kibana UI.

It will affect everywhere this user is used.

---

<div class="post-metadata">

### Author: ![juancamiloll](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juancamiloll/32/110326_2.png) [@juancamiloll](https://discuss.elastic.co/u/juancamiloll)
#### Post date: [September 16, 2025, 2:00pm UTC](https://discuss.elastic.co/t/change-elasticsearch-password/381983/3 "2025-09-16T14:00:08Z")

</div>

The key I currently use is very old, and I need to assign a new one.

Do I need to log in directly to each of the servers in the Elasticsearch cluster to modify the .yml or something like that? Or is there another method? That is my question.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [September 16, 2025, 2:05pm UTC](https://discuss.elastic.co/t/change-elasticsearch-password/381983/4 "2025-09-16T14:05:13Z")

</div>

> [@juancamiloll](#):
>
> Do I need to log in directly to each of the servers in the Elasticsearch cluster to modify the .yml or something like that?

No, the password is set on the cluster, it exists in the security index, to change it you need to use the [Change Password API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-change-password) or change it using the Kibana UI, in the User Management part.

After you change it will will also need to change any configuration that uses the old password, for example, if your in your `kibana.yml` you configures Kibana to use the `elastic` user and the old password, you will need to change it on the file and restart Kibana as well.

---

<div class="post-metadata">

### Author: ![juancamiloll](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juancamiloll/32/110326_2.png) [@juancamiloll](https://discuss.elastic.co/u/juancamiloll)
#### Post date: [September 16, 2025, 2:19pm UTC](https://discuss.elastic.co/t/change-elasticsearch-password/381983/5 "2025-09-16T14:19:00Z")

</div>

@leandrojmp

Thanks for your reply. To make sure I understand you correctly, I just need to log in from the Kibana graphical interface, then go to Dev Tools and run

> POST /\_security/user/elastic/\_password  
> {  
> "password": “pepsi”  
> }

Then I log in to Logstash via SSH and modify each of the .conf files with the new password.

Is that all? Or do I need to do anything else?

Should I restart Logstash after the change?

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [September 16, 2025, 2:30pm UTC](https://discuss.elastic.co/t/change-elasticsearch-password/381983/6 "2025-09-16T14:30:35Z")

</div>

> [@juancamiloll](#):
>
> Then I log in to Logstash via SSH and modify each of the .conf files with the new password.
> 
> Is that all? Or do I need to do anything else?
> 
> Should I restart Logstash after the change?

Yes, you need to change it in every configuration file you have and restar the services.

Also, as mentioned, if Kibana is configured to use the `elastic` user you also need to change this in Kibana configuration and restart the service.

If this is a production environment I suggest that you do those actions on a maintenance windows as they can impact the availability of your cluster.

---

<div class="post-metadata">

### Author: ![juancamiloll](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juancamiloll/32/110326_2.png) [@juancamiloll](https://discuss.elastic.co/u/juancamiloll)
#### Post date: [September 16, 2025, 3:40pm UTC](https://discuss.elastic.co/t/change-elasticsearch-password/381983/7 "2025-09-16T15:40:45Z")

</div>

Thank you very much, as always, for your valuable help. I was able to make the change.
