You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

sudo command not working after a security update

After installing a security update on my Mac, the sudo command stopped working. I searched a little online but the solutions there are so complex I don't seem to get it. I have waited patiently thinking subsequent updates will fix the issue but that hasn't been the case after installing two updates. Am out of options and I hope I can be helped here, Thanks.

MacBook Pro 15″, macOS 10.14

Posted on Jul 16, 2020 9:35 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 18, 2020 4:08 PM

sys_support Said:

"Still getting the same sudo error code ...."

-------


It seems the upgrade was unsuccessful.


Important:

Create a Time Machine Backup, then Update:

Prior to the update of your macOS, be certain to backup your Mac using a Time Machine Backup. That way, you can have something to restore your Mac from, should anything go wrong with the update. Use an external hard drive that is at least 1.5 the total storage capacity.


If you have no Time Machine to restore from then...


Reinstall the macOS:

Nothing would be deleted. It's just that items that have become corrupted or deleted, would be replaced or reinstalled back to where they should be. Go Here: How to reinstall macOS from macOS Recovery - Apple Support

9 replies
Question marked as Top-ranking reply

Jul 18, 2020 4:08 PM in response to sys_support

sys_support Said:

"Still getting the same sudo error code ...."

-------


It seems the upgrade was unsuccessful.


Important:

Create a Time Machine Backup, then Update:

Prior to the update of your macOS, be certain to backup your Mac using a Time Machine Backup. That way, you can have something to restore your Mac from, should anything go wrong with the update. Use an external hard drive that is at least 1.5 the total storage capacity.


If you have no Time Machine to restore from then...


Reinstall the macOS:

Nothing would be deleted. It's just that items that have become corrupted or deleted, would be replaced or reinstalled back to where they should be. Go Here: How to reinstall macOS from macOS Recovery - Apple Support

Jul 17, 2020 7:24 PM in response to sys_support

What happens if you type:

ls  ~


Do you get a list of folders for your home folder such as "Desktop", "Documents", "Downloads", "Library", "Music", etc.?


If this doesn't work, then for some reason "ls" is broken. If running the above command works, then try running:

sudo su -


to see if you get a root prompt #. Now type:

ls  /Users


Does this work and do you see your user account listed as well as "Shared Folder"?


Type "exit" to go back to a standard user prompt.

exit

Jul 19, 2020 7:43 AM in response to Matti Haveri

Matti Haveri Said:

Just a quick idea: I have heard that the "Local Hostname" at System Preferences > Sharing > Edit... might get changed after some recent updates. It indeed was somewhat different in my Mac than it used to be. I don't know if that explains sudo problems, though.”

———


Apple’s More Strict:

Well, the BIOS has been made more strict. You’d find that out, if you authored and ran your own, particular SUDO commands in AppleScript and Terminal. That’s what think you are referring to.


I have my ways to workaround it, though, and it’s been that way since macOS 10.13. Using beta for macOS 10.16, I’m working it on so my Terminal shells and AppleScript Apps run as desired.

sudo command not working after a security update

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