# Sudo service start throwing error as /home/ec2-user/elasticsearch-7.5.2/bin/elasticsearch: Perm... denied

**URL:** <https://discuss.elastic.co/t/sudo-service-start-throwing-error-as-home-ec2-user-elasticsearch-7-5-2-bin-elasticsearch-perm-denied/217502>\
**Category:** Elasticsearch\
**Created:** [February 1, 2020, 6:40pm UTC](https://discuss.elastic.co/t/sudo-service-start-throwing-error-as-home-ec2-user-elasticsearch-7-5-2-bin-elasticsearch-perm-denied/217502 "2020-02-01T18:40:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sridharspeaks](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@sridharspeaks](https://discuss.elastic.co/u/sridharspeaks)\
**Post date:** [February 1, 2020, 6:40pm UTC](https://discuss.elastic.co/t/sudo-service-start-throwing-error-as-home-ec2-user-elasticsearch-7-5-2-bin-elasticsearch-perm-denied/217502/1 "2020-02-01T18:40:00Z")

</div>

I installed elasticsearch 7.5.2 in AWS EC2 linux. I created required file in /etc/init.d/elasticsearch and added elasticsearch and group to this instance. Provided +x permissions to user.

However, when I am trying to do sudo service elasticsearch start and I getting an error that look like below.

Any help here will be greatly appreciated.

elasticsearch.service - LSB: This service manages the elasticsearch daemon  
Loaded: loaded (/etc/rc.d/init.d/elasticsearch; bad; vendor preset: disabled)  
Active: failed (Result: exit-code) since Sat 2020-02-01 18:33:25 UTC; 5min ago  
Docs: man:systemd-sysv-generator(8)  
Process: 18971 ExecStart=/etc/rc.d/init.d/elasticsearch start (code=exited, status=1/FAILURE)

xxx.compute.internal systemd[1]: Starting LSB: This service manages the elasticsearch daemon...  
xxx.compute.internal runuser[18979]: pam\_limits(runuser:session): invalid line '\* memlock unlimited' - skipped  
xxx.compute.internal runuser[18979]: pam\_unix(runuser:session): session opened for user elasticsearch by (uid=0)  
xxx.compute.internal elasticsearch[18971]: Starting elasticsearch: bash: /home/ec2-user/elasticsearch-7.5.2/bin/xxx  
xxx.compute.internal runuser[18979]: pam\_unix(runuser:session): session closed for user elasticsearch  
xxx.compute.internal elasticsearch[18971]: [FAILED]  
xxx.compute.internal systemd[1]: elasticsearch.service: control process exited, code=exited status=1  
xxx.compute.internal systemd[1]: Failed to start LSB: This service manages the elasticsearch daemon.  
xxx.compute.internal systemd[1]: Unit elasticsearch.service entered failed state.  
xxx.compute.internal systemd[1]: elasticsearch.service failed.

---

<div class="post-metadata">

**Author:** ![Magnus\_Kessler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnus_kessler/32/42001_2.png) [@Magnus\_Kessler](https://discuss.elastic.co/u/Magnus_Kessler)\
**Post date:** [February 3, 2020, 2:51pm UTC](https://discuss.elastic.co/t/sudo-service-start-throwing-error-as-home-ec2-user-elasticsearch-7-5-2-bin-elasticsearch-perm-denied/217502/2 "2020-02-03T14:51:14Z")

</div>

You appear to have installed Elasticsearch on a non-standard path (`/home/...`). Please check if all elements of the`/home/ec2-user/elasticsearch-7.5.2/bin/elasticsearch` path have the executable bit set. Please also ensure that the `/home` directory is mounted without the `noexec` mount option.

---

<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:** [March 2, 2020, 2:51pm UTC](https://discuss.elastic.co/t/sudo-service-start-throwing-error-as-home-ec2-user-elasticsearch-7-5-2-bin-elasticsearch-perm-denied/217502/3 "2020-03-02T14:51:20Z")

</div>

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