Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How do I allow an entire group, except a certain user in that group, to use sudo without providing password?

share|improve this question
add comment

1 Answer 1

It is enough to put the user line after th group line:

%admin ALL=NOPASSWD: ALL
enzotib ALL=(ALL:ALL) ALL

If you want to have many users to be requested the password, without adding them to /etc/sudoers, you can create a group just for that, say we name it dummy, then write the following

%admin ALL=NOPASSWD: ALL
%dummy ALL=(ALL:ALL) ALL

All users in the group admin and not in the group dummy can execute administrative tasks without entering the password.

All users in the group admin and in the group dummy (or only in the group dummy) can execute administrative tasks entering the password.

share|improve this answer
    
I need the configuration to work for new users, too, without adding them manually in visudo. –  johnny Nov 12 '11 at 18:30
3  
@traveller You asked how to enable all users in a group except one specific user to sudo to root without being prompted for a password. enzotib answered that question (assuming that you want that specific user to be able to sudo to root, just with a password). Do you want to edit your question? –  Eliah Kagan Nov 12 '11 at 19:12
    
I'm sorry I misunderstood the solution given by enzotib. It works. Thank you very much !! –  johnny Nov 12 '11 at 19:23
    
@traveller: see my updated answer. –  enzotib Nov 12 '11 at 19:27
1  
Please mark this answer as accepted if it has solved your problem. –  Caesium Dec 7 '11 at 18:07
add comment

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.