try this syntax in sudoers file:

username ALL=NOPASSWD: /home/<user>/shell-scripts/homenet.sh

Dumb question but you did change permissions on the script to make it
executable?  chmod 755 or chmod 700 or chmod +x ?  Please do not be
insulted as I am not trying to point out any faults, just looking for
obvious things that people sometimes overlook, me being no exception :)

On Sun, Mar 18, 2012 at 11:42 AM, Rich Shepard <[email protected]>wrote:

>   I'm far from competent with /etc/sudoers syntax.
>
>   I have a simple, one-line script in /home/<user>/shell-scripts/homenet.sh
> that I want to have run with root privileges (because it copies
> /etc/resolv.conf.home to /etc/resolv.conf).
>
>   With this line in /etc/sudoers
>
> %users = ALL=(root) NOPASSWD /home/<user>/shell-scripts/homenet.sh
>
> the command, 'shell-scripts/homenet.sh', tells me permission is denied to
> create the file. With no entry in /etc/sudoers but running the comand
> following 'sudo ' I'm told that the user is not allowed to execute the
> script as root on that host.
>
>   Please educate me in the proper syntax for /etc/sudoers so a user can run
> a shell script as root.
>
> TIA,
>
> Rich
>
>
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to