Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I would like to configure sudo such that users can run some specific commands without entering a password (for convenience) and can run all other commands by entering a password.

This is what I have, but this does not work; a password is always required:

Defaults    env_reset Defaults    timestamp_timeout = 1 

root    ALL=(ALL:ALL) ALL 

# Allow members of group sudo to execute any command 
%sudo   ALL=(ALL:ALL) NOPASSWD: /usr/sbin/pm-suspend, /usr/bin/apt-get, PASSWD: ALL 

#includedir /etc/sudoers.d

Note that this is a debian system which uses this adding users to the "sudo" group method.

Thanks.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You should be able to do something like:

Cmnd_Alias                WITHOUTPW = /path/to/cmd1, /path/to/cmd2
Defaults!WITHOUTPW        !authenticate
share|improve this answer
    
I get sudo: unknown defaults entry nopasswd'` when running commands in the list. I'll play with it and see if I can figure out what it's doing. –  jberryman Mar 16 '11 at 15:42
    
@jberryman: Sorry, I had it wrong. I think it should be !authenticate. I've revised my answer. –  Dennis Williamson Mar 16 '11 at 16:06
    
That seems to do it. Thanks! –  jberryman Mar 16 '11 at 17:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.