2

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

4
  • 1
    Did you use visudo to edit the file. Are you sure your config is valid?
    – Zoredache
    Dec 19, 2011 at 2:37
  • 1
    What does the output of sudo -l look like while logged in as userName?
    – Kyle Smith
    Dec 19, 2011 at 3:49
  • @Zoredache i used visudo , what do you mean with valid config ?
    – Eslam
    Dec 20, 2011 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, 2011 at 0:43

2 Answers 2

8

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).
1
  • 1
    you are right as output of sudo -l shows that there are two rules applied to that user
    – Eslam
    Dec 20, 2011 at 0:45
0

try

userName ALL = NOPASSWD: ALL
2

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