Elasticsearch user authentication plugin with http basic auth. This plugin provides user authentication APIs and its web console.
bin/plugin --url https://raw.githubusercontent.com/TomSearch/elasticsearch-http-user-auth/master/jar/http-user-auth-plugin-1.0-SNAPSHOT.jar --install http-user-auth-plugin
Add following lines to elasticsearch.yml:
http.user.auth.disabled: false http.user.auth.root.password: rootpassword
If you set http.user.auth.disabled
to true
, your Elasticsearch instance won't load this plugin.
http.user.auth.root.password
is a setting for root user's password literally.
Only the root user can access Elasticsearch root APIs (like /_cat, /_cluster) and all indices.
Other users can only access their own indices that are specified by an API of this plugin.
The authentication method of this plugin is Basic Authentication. Therefore, you should add your username and password to URL strings.
For example, you can call "You know, for search" API like this: http://root:[email protected]:9200/
If you're using some other plugins which use Elasticsearch APIs, you may have to set your root password in their configurations.
For example, configs of Marvel and Kibana 4 shold be as below:
elasticsearch.yml:
marvel.agent.exporter.es.hosts: ["root:[email protected]:9200"]
kibana.yml:
elasticsearch_url: "http://root:rootpassword@localhost:9200"
This plugin provides a web console managing users and their own indices.
http://your.elasticsearch.hostname:9200/_plugin/http-user-auth-plugin/index.html