MacOS – How to Get Root Access in Mojave

macosmojaverootsip

I need to copy "Network Diagnostics.app" into the Mojave Core Services library.

Running "csrutil disable" from terminal doesn't work, says you have to run from Recovery OS. I don't know if I have Recovery OS or not, only Mojave is installed.

Giving Finder "Full Disk Access" under "Security and Privacy" threw errors when I tried to copy the file (a circle with a line through it appeared when I tried to drag and drop).

Giving muCommander (a 3rd-party freeware file manager) Full Disk Access didn't work either, "unable to write to directory" error.

I read that this can be done through the command line, what would the syntax be? Is this correct:

sudo cp \Desktop\"Network Diagnostics.app\MacintoshHD\System\Library\CoreServices\Applications\

Seems strange that I can't run a program as Administrator, but I understand this was a deliberate decision by Apple. Is there a way to accomplish this?

Best Answer

Root isn’t what you need, SIP must be disabled if you desire to modify the system files while booted from the same system as the files to be edited.

A centerpiece is the protection of system-owned files and directories against modifications by processes without a specific "entitlement", even when executed by the root user or a user with root privileges (sudo).

https://en.wikipedia.org/wiki/System_Integrity_Protection

macOS Recovery is part of the built-in recovery system of your Mac. First, boot to recovery, then open terminal from recovery and run sudo -s to become root. Then you are clear to make modifications to the normal system on the Macintosh HD volume.

You could also run the disable from recovery and restart it you want to opt out of protection indefinitely and not just temporarily.

I’m generally not doing that but your system, your call totally.