Reset the elastic User Password

This procedure resets the password for the elastic user, the default superuser account in Elasticsearch.

  1. Navigate to the Elasticsearch bin directory (for example, C:\elastic\elasticsearch\<version>\bin).

  2. Open an elevated PowerShell window and run the following command:

    Copy
    .\elasticsearch-reset-password.bat -u elastic

    Optional: Run in interactive mode:

    Copy
    .\elasticsearch-reset-password.bat -i -u elastic
  3. When prompted, press 'Y' to confirm and reset the password. The output will look similar to:

    Sample output
    Copy
    PS C:\Elastic\elasticsearch-8.19.8\bin> .\elasticsearch-reset-password -u elastic
    warning: ignoring JAVA_HOME=C:\Elastic\elasticsearch-8.19.8\jdk; using bundled JDK
    This tool will reset the password of the [elastic] user to an autogenerated value.
    The password will be printed in the console.
    Please confirm that you would like to continue [y/N]y

    Password for the [elastic] user successfully reset.
    New value: 3D2nYt7r=rBPCzCCt3iy
    PS C:\Elastic\elasticsearch-8.19.8\bin>_
  4. Record and securely store the generated password immediately.

The password is shown only once and cannot be retrieved later. Store it according to your organization's credential management and security policies. This password is required for future authentication to Elasticsearch and Kibana.

Return to top of the page
Feedback