How to sudo with no password set - this works!
Macbook High Sierra 10.13
I just wanted to set my Macbook so that it doesn't start every time I open the display or turn the charger on.
So there is a terminal sudo command to do that, but it requires a password.
But I haven't set a password on my mac, so how can I proceed? Just hitting enter does not work (unlike the dialog windows that open sometimes). You can't have "no password"...!
What you can do (and I just did that) is to set a user password in the security settings, then do your sudo command in the terminal, using that new password.
After you did what you wanted to do, go to security settings again, type the "old" password (the one you just set) and leave the "new" password empty.
Now everything is just like before except the changes you did with sudo.
MacBook Pro 15″, macOS 10.13