Reputation: 218
I had generated passwords for elastic search using below command and I forgot to copy and backup passwords shown at console output
sudo -E ./elasticsearch-setup-passwords auto
When I tried executing it again , I am not able to regenerate passwords again, please help me in taking those passwords or guide me how to change password for user elastic
Upvotes: 0
Views: 8577
Reputation: 41
If you are not able to login kibana due to password not working and authentication error please use below process
./elasticsearch-users useradd elasticadmin -p elasticadmin -r superuser
Start elasticsearch process
Try running below command with new user you should get user list:
curl -u elasticadmin -XGET 'http://localhost:9200/_xpack/security/user?pretty'
Enter host password for user 'newadmin':
{ "elastic" : { "username" : "elastic", "roles" : [ "superuser" ], "full_name" : null, "email" : null, "metadata" : { "_reserved" : true }, "enabled" : true }, "kibana" : { "username" : "kibana", "roles" : [ "kibana_system" ], "full_name" : null,
curl --user elasticadmin:#l@$t!c@dm!n -XPUT "http://localhost:9200/_xpack/security/user/elastic/_password?pretty" -H 'Content-Type: application/json' -d'{ "password" : "typeyourpasswordhere"}'
curl -u elastic -XGET "http://localhost:9200/"
Upvotes: 4
Reputation: 217294
From the official documentation:
The elasticsearch-setup-passwords command uses a transient bootstrap password that is no longer valid after the command runs successfully. You cannot run the elasticsearch-setup-passwords command a second time. Instead, you can update passwords from the Management > Users UI in Kibana or use the security user API.
As stated in the part in bold, you can simply update the passwords from the Kibana UI.
Upvotes: 2