i am trying to sign in elasticsearch but i am getting this error

Viewed 22

this is command to set user: elasticsearch-users useradd suchit -p suchit -r network,monitoring but after running elasticsearch.bat on cmd i am getting error as follows:

{
  "error": {
    "root_cause": [
      {
        "type": "security_exception",
        "reason": "action [cluster:monitor/main] is unauthorized for user [suchit] with roles [monitoring,network], this action is granted by the cluster privileges [monitor,manage,all]"
      }
    ],
    "type": "security_exception",
    "reason": "action [cluster:monitor/main] is unauthorized for user [suchit] with roles [monitoring,network], this action is granted by the cluster privileges [monitor,manage,all]"
  },
  "status": 403
}
1 Answers

Tldr;

Reading the error message goes a long way.

You need to add at least the role monitor to your user suchit.

Solution

Based of the exemple in the documentation:

bin/elasticsearch-users roles suchit -a monitor
Related