Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question
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


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.