How to establish secured connection to elasticsearch

I am following the instructions on the "Getting Started with Elasticsearch" video, in which the Kibana connects to Elasticsearch with no security enabled.
But if Elasticsearch enabled security features, how to connect to it? Maybe use user account and password.

If you're using a recent version, and a trial license, you'll need to opt in to security to enable it. To do so, add xpack.security.enabled: true to your elasticsearch.yml file.

Once you do, you'll need to set the password for the user it connects as in the elasticsearch keystore and then tell Kibana that information. Our docs spend a lot of time talking about TLS and not a lot of time about the keystore. The gist is that you'll need to set the bootstrap.password value, like so:

./bin/elasticsearch-keystore add "bootstrap.password"

If you get an error that the value already exists, you can remove and then add it back. There might be a way to update it, but I don't know what that is, and removing and adding it back I know works.

The username is elastic, and assuming you set your password to changeme, you'll then need to add the following to your kibana.yml file:

elasticsearch.username: "elastic"
elasticsearch.password: "changeme"

Swap whatever value you actually set it to in place of changeme there.

Why the username is not "kibana"?

It's been "elastic" for a very long time, but I don't know specifically why that username was picked.

It may be possible to change that, but I don't know offhand how to do that.

I have done. Please see my post here:

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