What is the default user and password for Elasticsearch 7.8.0?

Viewed 8348

What's is the default username and password for Elasticsearch 7.8.0? It's asking this on 9200 port. Tried these (username pass):

  • elastic [no pass]
  • elastic elastic
  • without entering anything
  • elastic changeme
  • elastic password
  • user password

OS: Windows 10 x64, installed ES with MSI installer from its website.

yml file:

bootstrap.memory_lock: false
cluster.name: elasticsearch
http.port: 9200
node.data: true
node.ingest: true
node.master: true
node.max_local_storage_nodes: 1
node.name: LAPTOP-1C4GVFSU
path.data: C:\ProgramData\Elastic\Elasticsearch\data
path.logs: C:\ProgramData\Elastic\Elasticsearch\logs
transport.tcp.port: 9300
xpack.license.self_generated.type: basic
xpack.security.enabled: true

username pass C:\Program Files\Elastic\Elasticsearch\7.8.0 C:\Program Files\Elastic\Elasticsearch\7.8.0\bin

3 Answers

Somehow default username password isn't working. I had to set the password on CMD by

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.

Username is elastic and Password is password

  1. If you are trying to debug Elasticsearch Source Code, then after running ./gradlew :run, ES starts building and running.

Once the service has started, run this curl command from another window :

curl -u elastic:password localhost:9200

After which add the username and password as mentioned above. To know more about this refer CONTRIBUTING.md

  1. It may also be possible, that you have only added the xpack.security.enabled setting to the ES_PATH_CONF/elasticsearch.yml file.

After which if you try to hit localhost:9200, then it will ask for username and password (as you have enabled security feature). But since you have not set up username and password, so it will throw security_exception (when incorrect username and password are entered).

So, for that, run bin/elasticsearch-setup-passwords interactive, and set the username and password.

Refer to this documentation for Setting built-in user and password

Check /etc/nginx/ for nginx.con files and nginx passwd file. ElasticSearch is using simple Nginx passwd file and basic authentication for default instance.

Related