# Shield not respecting CONF\_DIR

**URL:** https://discuss.elastic.co/t/shield-not-respecting-conf-dir/46014
**Category:** Elasticsearch
**Tags:** elastic-stack-security
**Created:** [April 1, 2016, 3:58am UTC](https://discuss.elastic.co/t/shield-not-respecting-conf-dir/46014 "2016-04-01T03:58:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jakauppila](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakauppila/32/44935_2.png) [@Jakauppila](https://discuss.elastic.co/u/Jakauppila)
#### Post date: [April 1, 2016, 3:58am UTC](https://discuss.elastic.co/t/shield-not-respecting-conf-dir/46014/1 "2016-04-01T03:58:48Z")

</div>

So I'm running Elasticsearch on Windows and I am separating the Elasticsearch node configuration from Elasticsearch itself with the following structure:

D:\elasticsearch\elasticsearch-2.3.0\

- This is where Elasticsearch lives and we utilize the \plugins directory since they're version-specific.

D:\elasticsearch\elasticsearch-node\

- Within here, we use \config, \data, \logs, and \work

I am configuring the following environment variables on the server:

```auto
setx JAVA_HOME "D:\java\jre8"
setx DATA_DIR "D:\elasticsearch-node\data"
setx LOG_DIR "D:\elasticsearch-node\logs"
setx CONF_DIR "D:\elasticsearch-node\config"
setx ES_MIN_MEM "8g"
setx ES_MAX_MEM "8g"

```

When installing Shield, it is tossing the /shield configuration folder within _D:\elasticsearch\elasticsearch-2.3.0\config_ rather than my defined _D:\elasticsearch-node\config_ as overridden with the environment variable.

It appears that Elasticsearch itself is looking for the Shield configuration within %CONF\_DIR%, but when running _esusers_ to add an initial admin, it is getting written to _D:\elasticsearch\elasticsearch-2.3.0\config_

I believe to correct this, you would just need to check for the environment variable and add an additional value to the ES\_PARAMS within _.in.bat_ for Shield.

```auto
if "%CONF_DIR%" == "" set CONF_DIR=%ES_HOME%\config

```

```auto
set ES_PARAMS=-Des.path.home="%ES_HOME%" -Des.default.path.conf="%CONF_DIR%"

```

---

<div class="post-metadata">

### Author: ![Baboune](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baboune/32/4405_2.png) [@Baboune](https://discuss.elastic.co/u/Baboune)
#### Post date: [April 1, 2016, 9:42am UTC](https://discuss.elastic.co/t/shield-not-respecting-conf-dir/46014/2 "2016-04-01T09:42:25Z")

</div>

Hi,

On linux, the user running "esusers" commands seem to matter. When the user has the wrong access right, then the error message points to a faulty directory error like:

> ERROR: The configuration directory [/etc/elasticsearch/shield] does not exist. The esusers tool expects Shield configuration files in that location.  
> The plugin may not have been installed with the correct configuration path. If [/usr/share/elasticsearch/config/shield] exists, please copy the shield directory to [/etc/elasticsearch]

Changing user to an admin level user like root, then the message disappears.

See [Shield Authentication Error - #8 by Baboune](https://discuss.elastic.co/t/shield-authentication-error/44185/8)

But yes it seems shield ignores where the rest of the CONFIG\_DIR is and elects its own location, /etc/elasticsearch on linux.

---

<div class="post-metadata">

### Author: ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)
#### Post date: [April 5, 2016, 11:13am UTC](https://discuss.elastic.co/t/shield-not-respecting-conf-dir/46014/3 "2016-04-05T11:13:46Z")

</div>

Thank you for the feedback on the issues you've found with the esusers tool. I have opened issues for both problems

---

<div class="post-metadata">

### Author: ![geekpete](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geekpete/32/20409_2.png) [@geekpete](https://discuss.elastic.co/u/geekpete)
#### Post date: [July 14, 2016, 6:06am UTC](https://discuss.elastic.co/t/shield-not-respecting-conf-dir/46014/4 "2016-07-14T06:06:45Z")

</div>

Hi Jay,

Did you have github links for those issues?

Thanks.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 1:42pm UTC](https://discuss.elastic.co/t/shield-not-respecting-conf-dir/46014/5 "2017-07-06T13:42:54Z")

</div>


