Skip to main content

How to enable passwordless sudo in macOS

101 words·1 min

If you edit your /etc/host file on macOS or need to bind to a privileged port for local web testing then you’ll probably use sudo a lot. It can get really annoying having to constantly apply your password for each sudo command so just like in Linux we can disable the password prompt.

To do open up /etc/sudoers duplicate and uncomment the first %admin group entry

#%admin		ALL = (ALL) ALL

and replace with:

%admin		ALL = NOPASSWD: ALL

Now if you are a administrator on the local machine you should be able to use sudo with out any passwords. Horray!