I have a computer that doesn't not require a password. I'd like this to continue into sudo
, but unfortunately it doesn't recognise a user not having a password.
According to Apple the sudo
command requires a non-blank password: https://support.apple.com/en-gb/HT202035
Is there some way I can easily override this so I can have a blank password with sudo
? It's only ever a hindrance and security on this machine is not an issue. Thanks.
Best Answer
I found an answer that works perfectly (although it requires temporarily adding a password to your user first):
Open the Terminal
Type:
sudo visudo
Enter your user's password (create one if necessary).
Change this line FROM:
%admin ALL=(ALL) ALL
TO:
%admin ALL=(ALL) NOPASSWD: ALL
(press 'i' to enter insert mode if you can't edit the text)
Write and Quit
:wq
(press 'esc' first to enter command mode)