No permission for user, Tenant permission error

I try to run this command on elasticsearch server but i get error for permission, sorry for the noob question

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.

Some other command they run with success.

@maybe_yes Did you get this resolved?

The command you are running includes security index, which can only be changed using root certificate.

Please try curl with root cert as below:

curl -XPUT 'https://localhost:9200/_settings' -H 'Content-Type: application/json' --insecure --key "/path/to/kirk.key" \
   --cert "/path/to/kirk.pem" \
   --cacert "/path/to/root-ca.pem" -d '{
        "number_of_replicas" : 0,
        "auto_expand_replicas": false (needed as some of the indices have this on by default, and changes will not take place)