Elasticsearch: Couldn't login as the user Elastic

Hi,
Since I need teh login page for Kibana, I enabled the xpack.security.enable: true in kibana.yml and added elasticsearc.username: "some_username" and elasticsearch.password: "some_pwd"

After restarting Elasticsearch and kibana, It didn't show the login page for Kibana.

Then I added this pack.security.enabeld: true in elasticsearch.yml file. Then I got the login page in kibana UI also. But its was disabled.

Noticed that teh elasticsearch needs to be logged in. So i logged in as teh user "elastic".

But I got below log:

[INFO ][o.e.x.s.a.AuthenticationService] [E7h8aKO] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]

So I followed the steps in this thread.

But I am getting below error now. How to fixe it?

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

Thanks

Enter the correct password?

"reason" : "unable to authenticate user [my_admin] for REST request [/_xpack/security/user/elastic/_password?pretty]",

This means that the password you entered is not valid for the my_admin user. Since you haven't provided any details about the steps you went through to setup that user, it's impossible for us to tell you what's gone wrong.

Yes, When I tried teh default username and password for elasticsearch. It didn't clear through.
So I tried to create a new superuser. It also gave me the same error.

I enbled the xpack.security.enabeld: true in elasticsearch.yml file. After that only elastic search started prompting username and password.

Why I tried to do this is to get the login page in Kibana UI.

Below is the issue:

Hi,
Referred the video in this URL to set up the login account for Kibana UI(Version 6.3.0).
https://www.elastic.co/webinars/getting-started-kibana 1

I installed Kibana 6.3.0, but not X-pack separately. Since its not required for this version of Kibana.

In the above video, he installed the x-pack plugin using this command, bin/kibana-plugin install x-pack . If I run the command in terminal, It gave me this message
"Kibana now contains X-Pack by default, there is no longer any need to install it as it is already present.".
Does it mean that no need to install x-pack for Kibana 6.3.0? or Still need to install separately something like this in this guide?
https://www.elastic.co/guide/en/kibana/5.6/installing-xpack-kb.html

As mentioned in the demo,
enabled the elasticserach.username : "user"
elasticserach.password: "pass"

This was the one, when I saw the kibana.yml file.

After I start the cabin service using this command, bin/kibana the Kibana doesn't prompt for any username or password, directly teh home page loaded.

Am I missing any other setting in configuration files?

Can clarify what's wrong in the steps I did?

Thanks

Ignore Kibana. Let's get Elasticsearch working, and then we can worry about Kibana.

You need to give us a lot more detail than that.

  • What exactly did you try? Be as specific as you can. If you ran a command tell us exactly what you ran.
  • What "default username and password" are you referring to? Elasticsearch doesn't have a default username and password, so what exactly do you mean here?
  • What does "it didn't clear through" mean? Did you get an error? what was the error?
  • "I tried to create a new superuser" What are the exact step that you took? If possible copy-and-paste the commands from your terminal.
  • "It also gave me the same error." What error?

I added the below setting in elasticserach.yml file
xpack.security.enadled: true

Added below setting in kibana.yml
xpack.security.enadled: true

Removed the # symbol from settings in kibana.yml:
elasticsearch.username: "some_username"
elasticserach.password: "some_pwd"

So after start the elastic search service, while connecting to localhost:9200, It prompted for username and password.

entered the username "elastic" and password as "changeme". Found in some article that this is the default useraname and password. So used that to login. But I can't login using that user credential. Got below error in elasticsearch console
"[INFO ][o.e.x.s.a.AuthenticationService] [E7h8aKO] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]"

If there is no default username and password for elastic search, then how to login elasticsearch?

1 Like

This is why you need to be specific when you try and describe a problem, your original post skipped over these very basic facts that are critical to working through your problem.

You shouldn't just follow "some article" that you found. I don't know what you were reading, but it was clearly for an old version of Elasticsearch and isn't relevant to your version.

You should read the official docs for the version that you're running:

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