MacOS – Enable sudo without a password on MacOS

macospasswordsudo

My Problem

I would like to be able to run sudo commands on MacOS Sierra 10.12 without having to type a password.

What have I tried

I've read the following:

And changed the relevant part of my /etc/sudoers file to:

root ALL=(ALL) ALL
%admin  ALL=(ALL) NOPASSWD: ALL
%wheel ALL=(ALL) NOPASSWD: ALL
%wheel ALL=(ALL) NOPASSWD: ALL
%sudo   ALL=(ALL) NOPASSWD: ALL
adamatan ALL=(ALL) NOPASSWD: ALL

My local user id (whoami) is adamatan.

I'm still being asked to type a password every few minutes when calling sudo. Any idea what's wrong?

Best Answer

Open a terminal, run sudo visudo

Edit the line:

%admin ALL=(ALL) ALL

To say:

%admin ALL=(ALL) NOPASSWD: ALL

Now, you should now be able to run sudo without password.