Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-25-2003, 05:15 PM   #1
Registered: Feb 2003
Location: Cleveland, Ohio (USA)
Distribution: Gentoo, Kubuntu 6.06
Posts: 179

Rep: Reputation: 30
help with sudoers: can only specify one command

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/, /etc/init.d/
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,
/etc/init.d/, /etc/init.d/

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

also only lets bkay run the first command (in this case, gdm) in the list.
There has to be something obvious here. Please help!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 06:03 PM
Regarding SUDOERS hinetvenkat Linux - Networking 1 09-02-2005 02:47 PM
sudoers???? yenonn Slackware 6 02-10-2004 04:09 AM
sudoers........ help linuxlah Linux - General 4 01-15-2003 12:54 AM
help with /etc/sudoers keevitaja Linux - Newbie 5 08-17-2002 02:00 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration