Áú»¢¶Ä²©

This is a translation of the original English documentation page. Help us make it better.

8 Running agent as root

Starting with version 5.0.0 the systemd service file for Áú»¢¶Ä²© agent in official packages was updated to explicitly include directives for User and Group. Both are set to zabbix.

This means that the old functionality of configuring which user Áú»¢¶Ä²© agent runs as via zabbix_agentd.conf file is bypassed and agent will always run as the user specified in the systemd service file.

To override this new behavior create a /etc/systemd/system/zabbix-agent.service.d/override.conf file with the following content:

[Service]
       User=root
       Group=root

Reload daemons and restart the zabbix-agent service:

systemctl daemon-reload
       systemctl restart zabbix-agent

For Áú»¢¶Ä²© agent2 this completely determines the user that it runs as.

For old agent this only re-enables the functionality of configuring user in the zabbix_agentd.conf file. Therefore in order to run zabbix agent as root you still have to edit the agent configuration file and specify User=root as well as AllowRoot=1 options.

Áú»¢¶Ä²© agent

To override the default user and group for Áú»¢¶Ä²© agent, run:

systemctl edit zabbix-agent

Then, add the following content:

[Service]
       User=root
       Group=root

Reload daemons and restart the zabbix-agent service:

systemctl daemon-reload
       systemctl restart zabbix-agent

For Áú»¢¶Ä²© agent this re-enables the functionality of configuring user in the zabbix_agentd.conf file. Now you need to set User=root and AllowRoot=1 configuration parameters in the agent configuration file.

Áú»¢¶Ä²© agent 2

To override the default user and group for Áú»¢¶Ä²© agent 2, run:

systemctl edit zabbix-agent2

Then, add the following content:

[Service]
       User=root
       Group=root

Reload daemons and restart the zabbix-agent service:

systemctl daemon-reload
       systemctl restart zabbix-agent2

For Áú»¢¶Ä²© agent2 this completely determines the user that it runs as. No additional modifications are required.