Unable to change elastic user password


#1

I recently upgraded from 6.1 to 6.2. Until I installed x-pack plugin on elasticsearch and kibana I was able to query elastic using elastic user and empty password.

I tried following this documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/installing-xpack-es.html) but I am getting this error.

bin/x-pack/setup-passwords interactive

Failed to authenticate user 'elastic' against http://loclhost:9200/_xpack/security/_authenticate?pretty
Possible causes include:

  • The password for the 'elastic' user has already been changed on this cluster
  • Your elasticsearch node is running against a different keystore
    This tool used the keystore at /etc/elasticsearch/elasticsearch.keystore

ERROR: Failed to verify bootstrap password

I also tried to change the password for elastic user , this is what I got .

curl -XPOST -u elastic 'localhost:9200/_xpack/security/user/elastic/_password?pretty' -H 'Content-Type: application/json' -d'
{
"password": "password"
}
'
Enter host password for user 'elastic':
{
"error" : {
"root_cause" : [
{
"type" : "security_exception",
"reason" : "failed to authenticate user [elastic]",
"header" : {
"WWW-Authenticate" : "Basic realm="security" charset="UTF-8""
}
}
],
"type" : "security_exception",
"reason" : "failed to authenticate user [elastic]",
"header" : {
"WWW-Authenticate" : "Basic realm="security" charset="UTF-8""
}
},
"status" : 401
}


(kulkarni) #2

setup-passwords ( https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-passwords.html) uses the bootstrap password( https://www.elastic.co/guide/en/x-pack/6.0/setting-up-authentication.html#bootstrap-elastic-passwords) in order to set the password for the users. After you set a password for the elastic user, the bootstrap password is no longer active and this is why you get the second error

ERROR: Failed to verify bootstrap password.

Were you able to login with either kibana or logstash_system users and their auto-generated passwords ?

Now, if you don't remember the original password for elastic that setup-passwords created, or if you in any case need to reset it to something new, you can follow the instructions that @TimV has shared in this answer( I lost the password that has been changed)

Hope this helps,

Thanks
Rashmi


#3

Thanks.

I am still not able to reset password for elastic user following post mentioned above , but I was able to create another superuser and solve my problem that way.

curl -XPOST -u my_admin 'localhost:9200/_xpack/security/user/elastic/_password?pretty' -H 'Content-Type: application/json' -d'
{
"password": "password"
}

'
Enter host password for user 'admin':
{
"error" : {
"root_cause" : [
{
"type" : "index_not_found_exception",
"reason" : "no such index",
"resource.type" : "index_or_alias",
"resource.id" : ".security-6",
"index_uuid" : "na",
"index" : ".security-6"
}
],
"type" : "index_not_found_exception",
"reason" : "no such index",
"resource.type" : "index_or_alias",
"resource.id" : ".security-6",
"index_uuid" : "na",
"index" : ".security-6"
},
"status" : 404
}


(system) #4

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