# Metricbeat as unprivilleged user with init.d

**URL:** <https://discuss.elastic.co/t/metricbeat-as-unprivilleged-user-with-init-d/234524>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [May 27, 2020, 10:36am UTC](https://discuss.elastic.co/t/metricbeat-as-unprivilleged-user-with-init-d/234524 "2020-05-27T10:36:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [May 27, 2020, 10:36am UTC](https://discuss.elastic.co/t/metricbeat-as-unprivilleged-user-with-init-d/234524/1 "2020-05-27T10:36:10Z")

</div>

Hi,

In the past I always installed metricbeat and filebeat with centos 7+ which uses systemd. There I managed to run both beats as unprivileged user.

I am much familar with init.d, but I need to install the beats on centos 6.x which use init.d.  
How can I modify the init scripts or the installation method to run metricbeat as service (automatically starts on boot) and as unprivilleged user?

Can you give a hint or solution?

Thanks, Andreas

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [May 27, 2020, 2:32pm UTC](https://discuss.elastic.co/t/metricbeat-as-unprivilleged-user-with-init-d/234524/2 "2020-05-27T14:32:02Z")

</div>

found it.

The optional file `/etc/sysconfig/metricbeat` is sourced during the init process.  
So do the following:

- create file `/etc/sysconfig/metricbeat` with content:

`BEAT_USER=MY_NON_ROOT_USERNAME`

Maybe it helps someone.

Regards, Andreas

---

<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:** [June 24, 2020, 2:32pm UTC](https://discuss.elastic.co/t/metricbeat-as-unprivilleged-user-with-init-d/234524/3 "2020-06-24T14:32:04Z")

</div>

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