Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sudo problem (not the standard one)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Houdini
Apprentice
Apprentice


Joined: 14 Jun 2002
Posts: 224
Location: New Mexico Tech, Socorro, NM

PostPosted: Tue Sep 24, 2002 2:20 am    Post subject: sudo problem (not the standard one) Reply with quote

First of all, I will say that I have poured over the sudo and sudoers man pages, and looked at www.sudo.ws, and both have not helped with this problem.

I'm trying to give my user access to one command without password. Anything else as root I want to give the password for, but for emerge I would like to not use one. All the references I've found haven't covered this. They have covered:

Giving a user/group passwordless access to everything.
Code:
%wheel    ALL=(ALL)   NOPASSWD: ALL


Giving a user passwordless access to a list of commands.
Code:
user   ALL=(ALL) NOPASSWD: this,that,the_other


Giving a user passwordless access to a command (or set of commands), and passworded access to another list.
Code:
user   ALL=(ALL) NOPASSWD: this,that, PASSWD: the_other


But nothing like what I'm looking for. I tried the logical (I thought) progression of this:
Code:
houdini   ALL=(ALL) NOPASSWD: /usr/bin/emerge, PASSWD: ALL


I even tried explicitly denying passworded access to emerge:
Code:
houdini   ALL=(ALL) NOPASSWD: /usr/bin/emerge, PASSWD: ALL,!/usr/bin/emerge


It looks like this should work, and even sudo SAYS it will work:
Code:
houdini@w213a houdini $ sudo -l
User houdini may run the following commands on this host:
    (ALL) NOPASSWD: /usr/bin/emerge
    (ALL) ALL
    (ALL) !/usr/bin/emerge


But it still (!) asks me for a password when I try to run /usr/bin/emerge. If I have denied access (!/usr/bin/emerge), it won't go once I give it a password. Does anyone know why this is?

(I tried all of the above examples, and they all work until NOPASSWD: /usr/bin/emerge, PASSWD: ALL)
_________________
^]:wq
Back to top
View user's profile Send private message
Houdini
Apprentice
Apprentice


Joined: 14 Jun 2002
Posts: 224
Location: New Mexico Tech, Socorro, NM

PostPosted: Tue Sep 24, 2002 2:42 am    Post subject: Reply with quote

I swear, posting a question here puts me on the right track to an answer before anyone has even read it.

The answer:
Code:
houdini     ALL = (ALL)  PASSWD: ALL, NOPASSWD: /usr/bin/emerge


Yep, the priority evidently is last to first. While that makes sense, it's irritating.
_________________
^]:wq
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum