This administrator account must have a non-blank password, or Terminal will not allow you to access root privileges.

Enter sudo “\file path from hard drive to application. app/Contents/MacOS/application name”. For example, to open iTunes, type sudo “/Applications/iTunes. app/Contents/MacOS/iTunes” and press ⏎ Return. Enter the password for the administrator account you are currently logged into. Press ⏎ Return. If the command works, the application should open with root privileges. If Terminal says “command not found,” continue to the next step.

The executable often has the same name as the application, but it could have another name, such as “run. sh. " The executable file icon is usually a black square with the word “exec” in small letters.

The hyphen in the command is optional, but recommended. It sets the environmental variables and directory to those of the admin user, which limits the chance of accidental damage. [4] X Research source

Restart your computer. Hold down ⌘ Command + R after you hear the start up noise to enter Recovery Mode. Select Utilities from the top menu, then Terminal. Enter csrutil disable; reboot in Terminal. Let the computer restart as usual. You can now use the steps above to open any application with full root privileges. When you are finished, consider repeating these instructions with enable instead of disable to reinstate SIP.

For example, sudo nano /etc/hosts will open the hosts file with root access. It’s a good idea to make a backup before you edit any configuration files. To do this, enter sudo cp filepath_of_config_file new_filepath of backup. For example, sudo cp /etc/hosts /etc/hosts. backup creates a copy of the hosts file named hosts. backup. If you make a mistake, move the misconfigured file with (for example) sudo mv /etc/hosts /etc/hosts. bad and restore the backup with sudo cp /etc/hosts. backup /etc/hosts. [7] X Research source