Authentication to ElasticSearch using the custom readonlyrest plugin.

To add the user follow the below steps:


Download Readonlyrest Plugin, to download:
  1. Go to
  2. Select Product Elasticsearch plugin (Free).
  3. Elastic Stack Version 6.4.2
  4. Send to email email-id.
  5. Click Get It Now
  6. Download link is sent to the mentioned email.

Installing readonlyrest plugin:

/path to elastic search/bin/elasticsearch-plugin install

file:///path to readonlyrest-<version>.zip

Example: /usr/share/elasticsearch/bin/elasticsearch-plugin install file:///root/


  1. Change directory to /etc/elasticsearch.
  2. Edit readonlyrest.yml
  3. Add the following in the file:
    - name: <Description for the User>

    auth_key_unix: <Username>:<Hashed_Password>

  4. Restart Elasticsearch.


Sample User (Test/Test):
  - name: Accept GET,POST requests from user
     auth_key_unix: Test:

For Hashing of password:

./ <password>

Creating file:
  1. Go to
  2. Copy and write the code to file using the command:

    Paste the code and save the file using :wq.

  3. Change the permission on the file
    chmod 755
  4. Execute
    ./ <password>
Note: Authentication must be enabled in each elastic search instance in the cluster.