Would you like to learn how to enable the Elasticsearch user authentication on Ubuntu Linux? In this tutorial, we are going to show you how to enable the user authentication feature on the ElasticSearch server on 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 - Enable user authentication

Install the required packages.

Copy to Clipboard

Test your communication with the ElasticSearch server.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Verify the license installed on the ElasticSearch server.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

In our example, we have a basic license installed on the ElasticSearch server.

Enable the trial license on the ElasticSearch server.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Verify the license installed on the ElasticSearch server.

Copy to Clipboard

The user authentication is not available on the ElasticSearch basic license.

Tutorial ElasticSearch - Configure the user authentication

Stop the ElasticSearch service.

Copy to Clipboard

Edit the ElasticSearch configuration file named: elasticsearch.yml

Copy to Clipboard

Add the following lines at the end of the file.

Copy to Clipboard

Here is the original file, before our configuration.

Copy to Clipboard

Here is the file with our configuration.

Copy to Clipboard

Start the ElasticSearch service.

Copy to Clipboard

Test your communication with the ElasticSearch server.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

The ElasticSearch server is requiring user authentication.

Set the password for the ElasticSearch internal accounts.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Test your communication with the ElasticSearch server using the ELASTIC user account.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

You may choose to enter the user password on the command-line.

Copy to Clipboard

Congratulations! You have finished the ElasticSearch authentication configuration.