Search code examples
elasticsearchelasticsearch-opendistro

Opendistro elasticsearch, no permissions for [ ] and User [name=admin, roles=[admin]


I try to run this command on elasticsearch server but i get error for permission.

I use opendistro for elasticsearch

curl -XPUT 'localhost:9200/_settings' -H 'Content-Type: application/json' -H 'securitytenant: Private' -u admin --insecure -d '{
"index" : {
    "number_of_replicas" : 0
    }
}'

{“error”:{“root_cause”:[{“type”:“security_exception”,“reason”:“no permissions for [ ] and User [name=admin, roles=[admin], requestedTenant=Private]”}],“type”:“security_exception”,“reason”:“no permissions for [ ] and User [name=admin, roles=[admin], requestedTenant=Private]”},“status”:403}

I tried also with out securitytenant but with the same error permission.

Other command's they run with success.


Solution

  • I have the same problem after migrating to opendistro with elasticsearch 7.

    I did test creating new roles and cluster/index permissions, but didn't works.

    Finally, what I did is curl a more specific url, specifying the index pattern, something like ...

    curl -XPUT 'http://localhost:9200/logstash-*/_settings?pretty' -H 'Content-Type: application/json' -d '{"number_of_replicas": 0}' --insecure -u admin:...
    

    And it works XD.

    Acknowledge true.

    Try with that.

    Good look.