# How to create read-only user in elastic

**URL:** https://discuss.elastic.co/t/how-to-create-read-only-user-in-elastic/366749
**Category:** Elasticsearch
**Tags:** elastic-stack-sql
**Created:** [September 18, 2024, 3:54pm UTC](https://discuss.elastic.co/t/how-to-create-read-only-user-in-elastic/366749 "2024-09-18T15:54:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Samantha\_V](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samantha_v/32/137692_2.png) [@Samantha\_V](https://discuss.elastic.co/u/Samantha_V)
#### Post date: [September 18, 2024, 3:54pm UTC](https://discuss.elastic.co/t/how-to-create-read-only-user-in-elastic/366749/1 "2024-09-18T15:54:36Z")

</div>

Hi Team, there is a requirment to create read-only user for elastic. I tried my best but could not achieve it. I want to start from scratch. Please give me some suggestion how to achieve this.

---

<div class="post-metadata">

### Author: ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)
#### Post date: [September 18, 2024, 7:19pm UTC](https://discuss.elastic.co/t/how-to-create-read-only-user-in-elastic/366749/2 "2024-09-18T19:19:35Z")

</div>

Hi @Samantha_V

These documents can help you:

> **[Create or update users API | Elasticsearch Guide \[8.15\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html)**

> **[Create or update roles API | Elasticsearch Guide \[8.15\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html)**

---

<div class="post-metadata">

### Author: ![Samantha\_V](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samantha_v/32/137692_2.png) [@Samantha\_V](https://discuss.elastic.co/u/Samantha_V)
#### Post date: [September 19, 2024, 3:49am UTC](https://discuss.elastic.co/t/how-to-create-read-only-user-in-elastic/366749/3 "2024-09-19T03:49:04Z")

</div>

Hi @RabBit_BR

Thanks for the quick response i was not much clear about my requirement earlier.

Here, i am using elk as a container. So, if anyone wants to verify data in elastic, for them i want to create a read-only user. Here, i am trying to create a read-only user for user to access container for verifying the database. Please do help me out.

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [September 20, 2024, 1:04am UTC](https://discuss.elastic.co/t/how-to-create-read-only-user-in-elastic/366749/4 "2024-09-20T01:04:02Z")

</div>

> [@Samantha\_V](#):
>
> I tried my best but could not achieve it.

When asking for help, it is more effective if you describe the steps you've taken and where you got stuck.  
Without that we're just guessing and will only be able to give you generic advice.

---

<div class="post-metadata">

### Author: ![Samantha\_V](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samantha_v/32/137692_2.png) [@Samantha\_V](https://discuss.elastic.co/u/Samantha_V)
#### Post date: [September 20, 2024, 4:57am UTC](https://discuss.elastic.co/t/how-to-create-read-only-user-in-elastic/366749/5 "2024-09-20T04:57:57Z")

</div>

Hi @TimV  
My bad, here what i tried was using some of the curl command which refernced from elastic document to create the user where i failed.  
Similar approach i tried for Cassandra, the approach was creating the read-only user when i am trying to deploy cassandra using helm chart. So I am trying to find similar approach for Elastic also, to create a read-only user via values.yaml . I just need some refernces, whether this is achieveable .

Here, we are deploying elastic as a container in rke2 clsuter.

Sorry for inconvience, if my question was not clear.

Please do help me out.
