# Path "/usr/share/logstash/data" must be a writable directory -- Most secure way to make it so?

**URL:** <https://discuss.elastic.co/t/path-usr-share-logstash-data-must-be-a-writable-directory-most-secure-way-to-make-it-so/259338>\
**Category:** Logstash\
**Created:** [December 22, 2020, 7:38am UTC](https://discuss.elastic.co/t/path-usr-share-logstash-data-must-be-a-writable-directory-most-secure-way-to-make-it-so/259338 "2020-12-22T07:38:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danibe](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@danibe](https://discuss.elastic.co/u/danibe)\
**Post date:** [December 22, 2020, 7:38am UTC](https://discuss.elastic.co/t/path-usr-share-logstash-data-must-be-a-writable-directory-most-secure-way-to-make-it-so/259338/1 "2020-12-22T07:38:56Z")

</div>

Running '/usr/share/logstash/bin/logstash' as `root` works perfectly but obviously is not the recommended long term mode of use.

So, I did:

```
chown -R logstash:logstash conf.d
chmod -R 775 /usr/share/logstash/data
sudo usermod -a -G logstash myself

```

and tried to run logstash as `myself`.

But even after that I still receive:

`Path "/usr/share/logstash/data" must be a writable directory. It is not writable.`

In [an earlier post here](https://discuss.elastic.co/t/i-cannot-start-logstash-on-my-machine-error-message-inside/88900) it is suggested to:  
`chmod -R 777 /usr/share/logstash/data`

But isn't this compromising security? What is the point of giving `/usr/share/logstash/data` a user and group if it is world-writable?

Is there a better way to accomplish running logstash as a different user (belonging to the logstash group)?

---

<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:** [January 19, 2021, 7:39am UTC](https://discuss.elastic.co/t/path-usr-share-logstash-data-must-be-a-writable-directory-most-secure-way-to-make-it-so/259338/2 "2021-01-19T07:39:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
