Would you like to learn how to recover the Elasticsearch admin password? In this tutorial, we are going to show you how to use the ElasticSearch password recovery procedure to change the password of the admin user using the command-line of a computer running Ubuntu Linux.

• Ubuntu 18
• Ubuntu 19
• ElasticSearch 7.6.2

In our example, The ElastiSearch server IP address is 192.168.100.7.

Tutorial ElasticSearch – Password Recovery

First, we need to access the ElasticSearch server as Root user.

Use the following command to install the required packages.

Copy to Clipboard

Stop the ElasticSearch service.

Copy to Clipboard

Locate the command named: elasticsearch-users

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Create a new local administrator account on the ElasticSearch server.

Copy to Clipboard

In our example, we create a new local administrator account named Newadmin.

In our example, the password set to the account named Newadmin was Kamisama123.

Start the ElasticSearch service.

Copy to Clipboard

Use the local administrator account to change the password of the account named Elastic.

Copy to Clipboard

In our example, we changed the Elastic account password to kamisama123.

Try to authenticate on the ElasticSearch server using the Elastic account and the new password.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Congratulations! You successfully recovered the password of the ElasticSearch user named Elastic.