I'm having some trouble getting sudo to work...
I edit /etc/sudoers with visudo, like you're supposed to. I follow the instructions in the man pages... but only the first command specified for a user works. My sudoers file looks something like this:
root ALL=(ALL) ALL
bkay ALL = NOPASSWD: /usr/bin/gdm, /usr/bin/gdm-stop, /etc/init.d/halt.sh, /etc/init.d/reboot.sh
Problem is, bkay can only effectively run "sudo gdm" without his password. If he runs any of the other commands listed, he gets something like this:
sh-2.05b$ sudo gdm-stop
Sorry, user bkay is not allowed to execute 'gdm-stop' as root on Jack.
The problems here being 1) the command doesn't work and 2) bkay is being prompted for his password.
If the order of the commands is rearranged - for example:
bkay ALL = NOPASSWD: /usr/bin/gdm-stop, /usr/bin/gdm,
then bkay can still only run the first command (now gdm-stop) but none of the other commands. Splitting up the commands like so:
bkay ALL = NOPASSWD: /usr/bin/gdm
bkay ALL = NOPASSWD: /usr/bin/gdm-stop
still only lets bkay run the first command listed (in this case, gdm)
And finally, making many commands into a command alias:
Cmnd_Alias STUFF = /usr/bin/gdm, /usr/bin/gdm-stop
bkay ALL = NOPASSWD: STUFF
also only lets bkay run the first command (in this case, gdm) in the list.
There has to be something obvious here. Please help!