How to reset password of Elasticsearch user?
Issue: How to reset password of Elastic search user (Starting from ES version - 8.0)
Syntax:
bin/elasticsearch-reset-password
[-a, --auto] [-b, --batch] [-E <KeyValuePair]
[-f, --force] [-h, --help] [-i, --interactive]
[-s, --silent] [-u, --username] [--url] [-v, --verbose]
Steps:
- Open command prompt. Navigate to the bin folder of Elastic search installation.
- Generate a password for the elastic user with the elasticsearch-reset-password tool. The password is output to the command line.
- Command : C:\elasticsearch-8.9.0\bin>\bin\elasticsearch-reset-password -u elastic
- Where elastic is the username.
Other properties:
The following example resets the password of a native user with username user1 after prompting in the terminal for the desired password:
- bin/elasticsearch-reset-password --username user1 -i
The following example resets the password of a native user with username user2 to an auto-generated value prints the new password in the console. The specified URL indicates where the elasticsearch-reset-password tool attempts to reach the local Elasticsearch node:
- bin/elasticsearch-reset-password --url "https://172.0.0.3:9200" --username user2 -i