# How can i add new user into the searchguard's internal users

**URL:** <https://forum.search-guard.com/t/how-can-i-add-new-user-into-the-searchguards-internal-users/1359>\
**Category:** Search Guard\
**Created:** [March 7, 2019, 7:44am UTC](https://forum.search-guard.com/t/how-can-i-add-new-user-into-the-searchguards-internal-users/1359 "2019-03-07T07:44:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![k.zhelyazkov](https://avatars.discourse-cdn.com/v4/letter/k/91b2a8/32.png) [@k.zhelyazkov](https://forum.search-guard.com/u/k.zhelyazkov)\
**Post date:** [March 7, 2019, 7:44am UTC](https://forum.search-guard.com/t/how-can-i-add-new-user-into-the-searchguards-internal-users/1359/1 "2019-03-07T07:44:05Z")

</div>

Hi,  
i’m using searchguard 6 and elasticsearch version 6.5.4-24-0.

I’m trying to add new users into the searchguard storage.

For now i tried to add a the following user into the configuration:

```auto

cat >> ${ES_PLUGINS_DIR}/search-guard-6/sgconfig/sg_internal_users.yml << 'EOF'

fluentd:

hash: {{ .Values.elasticsearch.sgPasswordHash }}

roles:

- logstash

EOF

```

After that I start the elasticsearch, but it does not update the indice and the user is not created.

How can i say to the plugin to take the users from that config file and to update his indice from it?

---

<div class="post-metadata">

**Author:** ![jkressin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/jkressin/32/9_2.png) [@jkressin](https://forum.search-guard.com/u/jkressin)\
**Post date:** [March 12, 2019, 6:46pm UTC](https://forum.search-guard.com/t/how-can-i-add-new-user-into-the-searchguards-internal-users/1359/2 "2019-03-12T18:46:31Z")

</div>

This is not how the Search Guard configuration management works: The actual configuration is not kept in configuration files, but is stored in an Elasticsearch index. This allows for hot configuration reloading in a running cluster and also means you do not need to place any configuration files on your nodes (and keep them in sync):

> **[Main concepts](https://docs.search-guard.com/latest/main-concepts#the-search-guard-index)**
>
> How Search Guard extracts credentials from a request and how they are mapped to users, roles and permissions.

Generally speaking, there are three approaches:

1. Using sgadmin

This is a command line tool for uploading configuration files to the Search Guard configuration index. If you have used the Search Guard demo installer, it already created a pre-configured sgadmin\_demo.sh script which you can simply execute.

> **[Migrating configuration files](https://docs.search-guard.com/latest/sgadmin)**
>
> You can use sgadmin to migrate Search Guard 6 configuration files to the Search Guard 7 format automatically.

> **[Examples](https://docs.search-guard.com/latest/sgadmin-examples)**
>
> Example sgadmin calls to manage the Search Guard configuration and Elasticsearch settings

> **[sgadmin Troubleshooting](https://docs.search-guard.com/latest/troubleshooting-sgadmin)**
>
> How to troubleshoot problems and issues with the Search Guard sgadmin command line tool.

1. Use the REST API

When using the REST API you need to first configure the Search Guard roles that should have access to it:

> **[Access Control](https://docs.search-guard.com/latest/rest-api-access-control)**
>
> Configure role-based access control to different endpoints and methods of the REST API.

You can then use any of the endpoints to change configuration, like adding a user:

> **[Internal users API](https://docs.search-guard.com/latest/rest-api-internalusers)**
>
> How to use the users REST API endpoints to create, update and delete Search Guard users.

1. Use the Kibana Config GUI

The Config GUI uses the REST API under the hood, but has a graphical interface:

> **[Search Guard configuration GUI](https://docs.search-guard.com/latest/configuration-gui)**
>
> Use the Kibana configuration GUI to quickly and easily setup and configure Search Guard.

> **···**
>
> On Thursday, March 7, 2019 at 8:42:13 AM UTC+1, [k.zhelyazkov@sap.com](mailto:k.zhelyazkov@sap.com) wrote:
> 
> > Hi,  
> > i’m using searchguard 6 and elasticsearch version 6.5.4-24-0.
> 
> > 
> 
> > I’m trying to add new users into the searchguard storage.
> 
> > For now i tried to add a the following user into the configuration:
> 
> > 
> 
> > ```auto
> > 
> > ```
> 
> > cat \>\> ${ES\_PLUGINS\_DIR}/search-guard-6/sgconfig/sg\_internal\_users.yml \<\< ‘EOF’
> 
> > fluentd:
> 
> > hash: {{ .Values.elasticsearch.sgPasswordHash }}
> 
> > roles:
> 
> > - logstash
> 
> > EOF
> 
> > ```auto
> > 
> > ```
> 
> > 
> 
> > After that I start the elasticsearch, but it does not update the indice and the user is not created.
> 
> > 
> 
> > How can i say to the plugin to take the users from that config file and to update his indice from it?
> 
> >

---

<div class="post-metadata">

**Author:** ![luisarmando](https://avatars.discourse-cdn.com/v4/letter/l/c67d28/32.png) [@luisarmando](https://forum.search-guard.com/u/luisarmando)\
**Post date:** [February 28, 2020, 1:03am UTC](https://forum.search-guard.com/t/how-can-i-add-new-user-into-the-searchguards-internal-users/1359/3 "2020-02-28T01:03:13Z")

</div>

Hi there @jkressin

What if I deployed in a Kubernetes cluster? How can I access the sgadmin cli tool?

Thank you

---

<div class="post-metadata">

**Author:** ![srgbnd](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/srgbnd/32/506_2.png) [@srgbnd](https://forum.search-guard.com/u/srgbnd)\
**Post date:** [February 28, 2020, 7:48am UTC](https://forum.search-guard.com/t/how-can-i-add-new-user-into-the-searchguards-internal-users/1359/4 "2020-02-28T07:48:27Z")

</div>

@luisarmando , to get access to the `sgadmin` tool if you run Docker:

1. List active docker containers

```auto
docker ps

```

1. Identify a container where Elasticsearch is running
2. Attach to the container

```auto
docker exec -it <container_id> /bin/bash

```

1. Find sgadmin

```auto
find / -name sgadmin*

```

---

<div class="post-metadata">

**Author:** ![luisarmando](https://avatars.discourse-cdn.com/v4/letter/l/c67d28/32.png) [@luisarmando](https://forum.search-guard.com/u/luisarmando)\
**Post date:** [March 2, 2020, 4:41am UTC](https://forum.search-guard.com/t/how-can-i-add-new-user-into-the-searchguards-internal-users/1359/5 "2020-03-02T04:41:58Z")

</div>

Thank you @srgbnd
