I have read a lot of articles on the subject and I am not able to do that in centos 7 the zabbix agent can use sudo commands without disabling the selinux.
I have installed the agent Zabbix, I have included the necessary permissions in the sudoers file so that the password is not required, but when trying to execute a script that makes a simple "sudo touch /opt/wildfly/standalone/deployments/wars.query2" an error is generated. If I deactivate selinux, everything goes fine, but if I try "tail -f /var/log/audit/audit.log | grep denied | audit2allow -M zabbix_agent_setrlimit; semodule -i zabbix_agent_setrlimit.pp" to generate the necessaries exceptions, I still get permission errors runing the script.
Is it possible to get this without disabling selinux?
Here is an example.
In Linux console, I can execute "sudo -u zabbix sudo touch /opt/wildfly/standalone/deployments/wars.query2" without any problem.
I have installed the agent Zabbix, I have included the necessary permissions in the sudoers file so that the password is not required, but when trying to execute a script that makes a simple "sudo touch /opt/wildfly/standalone/deployments/wars.query2" an error is generated. If I deactivate selinux, everything goes fine, but if I try "tail -f /var/log/audit/audit.log | grep denied | audit2allow -M zabbix_agent_setrlimit; semodule -i zabbix_agent_setrlimit.pp" to generate the necessaries exceptions, I still get permission errors runing the script.
Is it possible to get this without disabling selinux?
Here is an example.
- sudo touch /opt/wildfly/standalone/deployments/wars.query2
- echo | sudo tee -a /opt/wildfly/standalone/deployments/wars.query3
- sh: /usr/bin/sudo: Permission denied
- sh: line 1: /usr/bin/sudo: Permission denied
In Linux console, I can execute "sudo -u zabbix sudo touch /opt/wildfly/standalone/deployments/wars.query2" without any problem.
Comment