Q&A: Sudo outside Terminal

Q Is there a sudo facility outside Terminal, enabling you to ‘Open with Authentication’, for example?

A Terminal’s command sudo allows any user to assume the privileges of another user for one command. For example, sudo rm thisfile allows you to delete the file thisfile as if you had the privileges and permissions of the root user, and sudo is most commonly used to execute commands with root privileges.

Although there is nothing quite like that in the GUI world of the Finder, the interface does sometimes help you assume root privileges when needed. If you want to modify folders to which you have read but not write access, such as /Library/PreferencePanes, the Finder asks you if you wish to authenticate to achieve the same as sudo would.

However you cannot opt to run an application as the root user, nor can you open folders to which you do not at least have read access. If you want to do any of those things, you will need to work through Terminal’s sudo command, or log on using a user account which does have access to those folders.

Updated from the original, which was first published in MacUser volume 26 issue 4, 2009.