Home > Net >  Elasticsearch_Installation_asking for username and password
Elasticsearch_Installation_asking for username and password

Time:02-28

After installation of Elasticsearch and running the elasticsearch.bat command. I need to check in https:localhost9200. Here I am getting a prompt asking for username and password.

Is there any default username or password???

CodePudding user response:

You can Generate a new password using

/usr/share/elasticsearch/elasticsearch-setup-passwords auto/interactive

interactive is where you will have to enter password for all user.

auto will just print passwords on the shell.

else

You can turn off x-pack security in elasticsearch.yml

CodePudding user response:

Answer written by @harshit is correct, Adding more information so that it would be more helpful to the users running ES from code or want more context.

When you run it with source there is default username/password(applicable even in the ES 8.0) as mentioned in the ES code contribution guide and elastic is the default username and password is the default password.

Note that, from ES 8.0 even in Basic and trial ES version x-pack security is enabled by default, and it was disabled before ES 8.0. So if you want to disable it you need to add below setting to your elasticsearch.yml and restart ES.(Not recommended though)

xpack.security.enabled: false

Also, elastic is a reserved username in Elasticsearch, and when you install ES from an archive on *nix based system, its password is not generated due to known issue, but if you running it on Docker or on Windows it would be generated and password will be printed in the cluster logs as explained in official doc, where ES advises to store it in secure location.

  • Related