Sudo keeps asking for password, despite that NOPASSWD already set

The following sudoers configuration used to work well in MacOS 10.8.5, several days ago I upgraded to Mavericks, NOPASSWD flag does not seem to work anymore:

# User privilege specification
root    ALL=(ALL) ALL
howard  ALL=(ALL) NOPASSWD: ALL
%admin  ALL=(ALL) ALL

Mavericks' sudo still asks for entering password.

Is there any resolution/workaround?


Solution 1:

The group entry %admin ALL=(ALL) ALL seems to override the user specific entry. I found moving the user specific entry so that is appears after the group entry fixes this. Maybe sudo parses the entire file and it uses the last matching entry?

Changing your sudoers file to something similar to below should work.

# User privilege specification
root    ALL=(ALL) ALL
%admin  ALL=(ALL) ALL
howard  ALL=(ALL) NOPASSWD: ALL