sudo configuration for NOPASSWD: ALL

Hey all,


I have a new mac with a fresh 10.8 installed. It's 2 days old and (probably) in the best shape of its life. Here's the problem:


As a Linux guy, I'm using sudo alot and it prompts me for a password every single time. Example:


host_name:~ user_name$ sudo cat /etc/autofs.conf

Password:

etc...


This is getting tedious. In Linux we simply add ourselves to the wheel group and uncomment this line in /etc/sudoers:

# %wheel ALL=(ALL) NOPASSWD: ALL


I've done some troubleshooting on my own but all paths lead to more questions:

Step 1; find out about me:

host_name:~ user_name$ id

uid=501(user_name) gid=20(staff), groups=20(staff), 401(com.apple.access_screensharing), 402(com.apple.sharepoint.group.1), 12(everyone), 33(_appstore), 61(localaccounts), 79(_appserverusr), 80(admin), 81(_appserveradm), 98(_lpadmin), 100(_lpoperator), 204(_developer), 403(com.apple.access_ssh)

-good.


Step 2; grep /etc/passwd for my user account

host_name:~ user_name$ grep user_name /etc/passwd

-nothing.


I can't find my user_name in the password file; OK, now I'm confused.


2 questions - 1 purpose:

  1. How do I configure /etc/sudoers to not prompt me for the password at all - ever again? OR
  2. What's the preferred method of getting the same functionality in OS X?



Thanks in advance,


TT

MacBook Pro, OS X Mountain Lion (10.8.2), i7, 16GB, 750GB, late 2011

Posted on Oct 25, 2012 6:42 PM

Reply
3 replies

Oct 26, 2012 4:34 PM in response to JesusPresley

This was a "Duh" moment for me. I steped out, had some dinner and a scotch, and magically, the answer came. Being a member of the "admin" group, it was that line which needed modification, not wheel:


  1. Open the Terminal
  2. sudo visudo
    Change this line FROM:
    $ %admin ALL=(ALL) ALL
    TO:
    $ %admin ALL=(ALL) NOPASSWD: ALL
  3. Write and Quit
    :wq


Retest successful; sudo no-longer nags me for a password.


Scotch is good.


🙂

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

sudo configuration for NOPASSWD: ALL

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.