# Permission denied just after installation

**URL:** <https://discuss.elastic.co/t/permission-denied-just-after-installation/319568>\
**Category:** Elasticsearch\
**Created:** [November 22, 2022, 3:46pm UTC](https://discuss.elastic.co/t/permission-denied-just-after-installation/319568 "2022-11-22T15:46:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Broot](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@Broot](https://discuss.elastic.co/u/Broot)\
**Post date:** [November 22, 2022, 3:46pm UTC](https://discuss.elastic.co/t/permission-denied-just-after-installation/319568/1 "2022-11-22T15:46:33Z")

</div>

I'm trying to install and run Elasticsearch and Kibana and I can't do it because every time I try, I always get some Access Permission Denied.

I'm on Ubuntu 20.04 thus installing via Debian

for example :

```auto
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
/usr/share/elasticsearch/bin/elasticsearch-env: line 78: /etc/default/elasticsearch: Permission denied

```

(yeah the kibana config was created in an other folder so I have to manually change the PATH variable)

```auto
> KBN_PATH_CONF=/etc/kibana /usr/share/kibana/bin/kibana
FATAL CLI ERROR Error: EACCES: permission denied, open '/etc/kibana/kibana.yml'

```

chmod shows this for /etc/default/(elasticsearch)

```auto
-rw-rw---- 1 elasticsearch elasticsearch 546 Nov 9 22:09 elasticsearch

```

Is it normal behavior?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 22, 2022, 8:23pm UTC](https://discuss.elastic.co/t/permission-denied-just-after-installation/319568/2 "2022-11-22T20:23:28Z")

</div>

Hi @Broot Welcome to the commuity..

> [@Broot](#):
>
> `/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token`

can you try  
`sudo /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana`

---

<div class="post-metadata">

**Author:** ![Broot](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@Broot](https://discuss.elastic.co/u/Broot)\
**Post date:** [November 23, 2022, 10:13am UTC](https://discuss.elastic.co/t/permission-denied-just-after-installation/319568/3 "2022-11-23T10:13:07Z")

</div>

thank you very much it works, thus for elasticsearch commands (as create-enrollment-token) I have to use the root access (with sudo)?  
But what about Kibana?  
When this is the output of

```auto
> sudo KBN_PATH_CONF=/etc/kibana /usr/share/kibana/bin/kibana
Kibana should not be run as root. Use --allow-root to continue.

```

Is it safe to just use --allow-root?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 23, 2022, 4:14pm UTC](https://discuss.elastic.co/t/permission-denied-just-after-installation/319568/4 "2022-11-23T16:14:13Z")

</div>

No don't start Kibana as root or elasticsearch...

We just need sudo for a couple commands.

---

<div class="post-metadata">

**Author:** ![Broot](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@Broot](https://discuss.elastic.co/u/Broot)\
**Post date:** [November 24, 2022, 10:10am UTC](https://discuss.elastic.co/t/permission-denied-just-after-installation/319568/5 "2022-11-24T10:10:10Z")

</div>

How can I start Kibana, if running the program gets a "permission denied".  
as in here :

```auto
> KBN_PATH_CONF=/etc/kibana /usr/share/kibana/bin/kibana
FATAL CLI ERROR Error: EACCES: permission denied, open '/etc/kibana/kibana.yml'

```

thank you in advance for your answer

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 24, 2022, 3:58pm UTC](https://discuss.elastic.co/t/permission-denied-just-after-installation/319568/6 "2022-11-24T15:58:35Z")

</div>

exactly how How did you install Kibana  
If you installed as a .deb or .rpm which it looks like you did .

You then start with

`sudo systemctl start kibana`

As described in the [documentation](https://www.elastic.co/guide/en/kibana/current/deb.html#deb-running-systemd).

---

<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:** [December 22, 2022, 3:59pm UTC](https://discuss.elastic.co/t/permission-denied-just-after-installation/319568/7 "2022-12-22T15:59:27Z")

</div>

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