-   Linux - Security (
-   -   sudo access for a user to a script (

kaplan71 01-18-2011 01:21 PM

sudo access for a user to a script
Hi there --

I am trying to get a non-root account on one of our servers to run a script with sudo capability. To that end, I went into the /etc/sudoers file, and added the following syntax:


## Enable the nagios user to run the script as root
nagios  ALL=NOPASSWD: /usr/local/nrpe/libexec/, /sbin/iptables

I restarted the nagios service, and tested the results. The results were the user account still could not run the script due to the user, nagios, not having permission to run the iptables binary.

Is there another step(s) that I need to take in order to get the sudo access available to the user account?

stress_junkie 01-18-2011 01:28 PM

Are you sure that is the privilege violation? On my system, Ubuntu 10.04, any user can run iptables. That is the default file permission. However there may be a privilege violation if the ordinary user tried to change the tables or perform some other function within iptables.

Maybe something else in nagios or iptables is not being granted privileged access.

Naturally you are trying this by preceding the command with sudo aren't you?

sudo iptables --list

All times are GMT -5. The time now is 12:23 PM.