# Can't start elasticsearch service after enabling TLS for Detections/Alerts - Permission Denied

**URL:** <https://discuss.elastic.co/t/cant-start-elasticsearch-service-after-enabling-tls-for-detections-alerts-permission-denied/261330>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security, elastic-stack-alerting\
**Created:** [January 16, 2021, 6:53pm UTC](https://discuss.elastic.co/t/cant-start-elasticsearch-service-after-enabling-tls-for-detections-alerts-permission-denied/261330 "2021-01-16T18:53:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yarooski](https://avatars.discourse-cdn.com/v4/letter/y/ea5d25/32.png) [@yarooski](https://discuss.elastic.co/u/yarooski)\
**Post date:** [January 16, 2021, 6:53pm UTC](https://discuss.elastic.co/t/cant-start-elasticsearch-service-after-enabling-tls-for-detections-alerts-permission-denied/261330/1 "2021-01-16T18:53:18Z")

</div>

After following these instructions meticulously: [How To Install Elasticsearch, Logstash, and Kibana (Elastic Stack) on Ubuntu 20.04](https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elastic-stack-on-ubuntu-20-04)

And then enabling TLS and setting up user permissions here: [Detections prerequisites and requirements](https://www.elastic.co/guide/en/security/current/detections-permissions-section.html#enable-detections-ui)

We repeatedly run into a permissions issue when trying to start the elasticsearch service:  
`./elasticsearch-env: line 81: /etc/default/elasticsearch: Permission denied`

After doing an ls -l on the directory, all files are owned by the elasticsearch user created during setup, which seems correct. It appears since I am trying to start the service as my personal or sudo user it denies me. We're experimented with doing a `chown -r` on the directory to one of our personal users and we get past the error, but run into another down the line where the startup of the service calls another directory which is also owned by the same elasticsearch user.

It doesn't seem right to have to change permissions on these startup files for the service, could it be that we're attempting to run the service in an incorrect way? Hoping to get some insight or advice on this, we've done the setup several times now to make sure we follow the installer directions correctly and are still running into the exact same thing every time, TIA.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 17, 2021, 10:58pm UTC](https://discuss.elastic.co/t/cant-start-elasticsearch-service-after-enabling-tls-for-detections-alerts-permission-denied/261330/2 "2021-01-17T22:58:27Z")

</div>

Can you please post your elasticsearch.yml.

> [@yarooski](#):
>
> After following these instructions meticulously: [How To Install Elasticsearch, Logstash, and Kibana (Elastic Stack) on Ubuntu 20.04](https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elastic-stack-on-ubuntu-20-04)

I'd recommend following the related documentation here - [Elastic Installation and Upgrade Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elastic-stack/current/index.html)

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [January 19, 2021, 11:09am UTC](https://discuss.elastic.co/t/cant-start-elasticsearch-service-after-enabling-tls-for-detections-alerts-permission-denied/261330/3 "2021-01-19T11:09:23Z")

</div>

I haven't seen the blog post you mention so I can't speak to its correctness, but in addition to the link that Mark shared with you, you can always use the official documentation for installing using a deb package in [https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html)

---

<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:** [February 16, 2021, 11:09am UTC](https://discuss.elastic.co/t/cant-start-elasticsearch-service-after-enabling-tls-for-detections-alerts-permission-denied/261330/4 "2021-02-16T11:09:25Z")

</div>

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