Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default Username and Password for ElasticSearch 7.2.0 (when x-pack enabled)?

I did the change in config/elasticsearch.yml to

xpack.security.enabled: true

And now after starting elasticsearch (./bin/elasticsearch) and then do: curl localhost:9200

getting:

{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}

Then tried these 2:

curl localhost:9200 -u elastic:elastic
curl localhost:9200 -u elastic:changeme

getting:

{"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}%

What is the default username/password for Elasticsearch 7.2.0?

like image 605
Joe Avatar asked Oct 21 '25 12:10

Joe


1 Answers

You need to use elasticsearch-setup-passwords util to generate/set password for the inbuilt user of elastic.

To setup password you can use either one of the following commands:

bin/elasticsearch-setup-passwords interactive

bin/elasticsearch-setup-passwords auto

The interactive parameter prompts new password for the users, whereas auto generates them for you.

elastic user is the superuser for elastic-cluster.

Read more one configuring security here.

like image 152
Nishant Avatar answered Oct 23 '25 06:10

Nishant