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

i edited /etc/sudoers using visudo command so as to grant user sudo privilege without password as following :

userName ALL=(ALL:ALL) NOPASSWD:ALL

but it didn't work for me ,

any suggestions Thanks in advance

share|improve this question
1  
Did you use visudo to edit the file. Are you sure your config is valid? –  Zoredache Dec 19 '11 at 2:37
1  
What does the output of sudo -l look like while logged in as userName? –  Kyle Smith Dec 19 '11 at 3:49
    
@Zoredache i used visudo , what do you mean with valid config ? –  Eslam Dec 20 '11 at 0:41
    
@KyleSmith :Matching Defaults entries for emamdouh on this host: env_reset User emamdouh may run the following commands on this host: (ALL : ALL) NOPASSWD: ALL (ALL) ALL –  Eslam Dec 20 '11 at 0:43
add comment

migrated from stackoverflow.com Dec 18 '11 at 23:46

This question came from our site for professional and enthusiast programmers.

closed as off topic by SvW, Shane Madden, Bart De Vos, Ward, MDMarra Dec 19 '11 at 20:05

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

up vote 8 down vote accepted

Make sure that no rule below your mentioned rule are overriding it. From man sudoers (1.7.2p2):

   When multiple entries match for a user, they are applied in order.
   Where there are multiple matches, the last match is used (which is not
   necessarily the most specific match).
share|improve this answer
    
you are right as output of sudo -l shows that there are two rules applied to that user –  Eslam Dec 20 '11 at 0:45
add comment

try

userName ALL = NOPASSWD: ALL
share|improve this answer
    
Please expand on your answer (why should they try this? what does it do?) -- See blog.serverfault.com/2011/06/09/press-the-green-button-twice –  voretaq7 Dec 19 '11 at 3:25
    
nope, this wasn't the problem, the problem was that there was two rules applied to that user –  Eslam Dec 20 '11 at 0:46
add comment

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