Is Any Way to change uid of opensearch?

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):


Describe the issue:


Is Any Way to change uid of opensearch ?

I see opensearch build image with uid 1000 .

In elasticseach I can change uid using following solution Any way to change uid of elasticsearch user in docker image?

However opensearch image would show error .

/bin/sh: /usr/sbin/groupmod: Permission denied


my current user uid is 1001 and at first my certificate is permission 0600 .

opensearch would show unable to read esnode.pem .

Likely root cause: OpenSearchException[Unable to read /usr/share/opensearch/config/tls/esnode.pem (/usr/share/opensearch/config/tls/esnode.pem). Please make sure this files exists and is readable regarding to permissions. Property:]

I need to change certificate permission to 0644 and data dictionary to 0777 and opensearch can start .

But I don’t want to change my certificate and data dictionary permission .

Thanks .


  • opensearch.yml true tls/esnode.pem tls/esnode-key.pem tls/root-ca.pem tls/esnode.pem tls/esnode-key.pem tls/root-ca.pem

  • docker-compose.yml
    image: opensearchproject/opensearch:2.4.1
      - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
      - 'OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m' # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
      - 'OPENSEARCH_PATH_CONF=/usr/share/opensearch/config'
      - ./data:/usr/share/opensearch/data
      - ./tls:/usr/share/opensearch/config/tls
      - ./opensearch.yml:/usr/share/opensearch/config/opensearch.yml

Relevant Logs or Screenshots: