[sudo-users] sudo script doesn't think its totally root

Carville, Stephen scarville at LANDAM.com
Thu Nov 22 12:50:00 EST 2007

> At work, we have a cluster with a head node and a set of slave nodes.  I
> have been trying to setup a sudo config file to allow a user to issue a
> shutdown or reboot of all the slave nodes via the sudo command.  I have
> something that works with a caveat.  


> There was a command provided on the head node (/root/bin/donodes) which
> will execute the command specified on the command line for all the
> nodes.  This donodes command is a bash script and looks for a file in
> "~/.nodes" which contains the names of the various node machines.  There
> is a .nodes file in roots home directory. I set up an sudo entry as
> follows


> jim  ALL=/root/bin/donodes shutdown *


> and allows jim to perform "sudo /root/bin/donodes shutdown -h now" and
> works as long as jim has a .nodes file in his home directory.  I would
> have thought that the donodes command is being run as root and would
> find the ~/.nodes file in roots home directory.  While its not that big
> of a deal to have jim have this .nodes in his home directory, is there a
> way to config the sudo so that when donodes is executed it thinks that
> root is running it?
sudo -H /root/bin/donodes shutdown ... etc

More information about the sudo-users mailing list