Hi ,
I forgot my password for my elasticsearch
I configured my elasticsearch.yml with:
network.host: 0.0.0.0
discovery.seed_hosts: [“127.0.0.1”, “[::1]”]
discovery.type: single-node
xpack.security.enabled: true
I ran the command before
./bin/elasticsearch-setup-passwords interactive
is there any way to change my password again?
stephenb
(Stephen Brown)
September 2, 2024, 2:38pm
2
@stephane_chan
what version are you on...
https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-password.html
I'm using elasticsearch version 7.17
stephenb
(Stephen Brown)
September 3, 2024, 2:29pm
4
Hi @stephane_chan
Not easy in 7.17 take a look at this post
In short you need to create a new local superuser
Then reset the elastic password using the API and that new super user.
What you need is to define a superuser with elasticsearch-users CLI. Then use that newly created user to call ChangePassword API to change password for the elastic user.
As @warkolm mentioned, you could use elasticsearch-reset-password if you are on version 8.x, which basically automates the above process for you (it also deletes the newly created user after the password change is completed).