Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

Posted on Jun 18, 2023 1:38 AM

Reply

Similar questions

3 replies

Jun 19, 2023 2:10 AM in response to Rudegar

You understood that wrong. Sudo does only work with a password.


My description was about what you can do if you don’t have a login password set.

In that case it is not possible to use a sudo command. So I set up a login password, used that for sudo and removed it after that.

For the next sudo command you‘ll have to repeat the procedure.


No security issue at all 😃

Jun 18, 2023 6:48 AM in response to playwithjunk

this sounds like a serious security issue, if you click some scripts that gets to have sudo access without password then it would enable people to do all sorts of things like encrypting your phone drive and holding it for ransom to get you to pay them bitcoins ad libitum, if it was me then I would report this to apple as a serious problem

Report a security or privacy vulnerability - Apple Support

How to sudo with no password set - this works!

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