UPDATE (9/28/09): Got Snow Leopard? Please see this post for updated instructions.
— — — —
It’s occasionally handy when troubleshooting a problem in OS X to have root access in the Finder without having to log out of your current session. Sure, you can do most things in the Terminal, but the GUI can be much handier for certain tasks. This is a quick-and-dirty Terminal trick to open a Finder window with root access.
Run the following command and then enter your password:
A new Finder window resembling the following should open:
You can see that it opens up to the root user’s home. Use this window to navigate anywhere you like and make the changes you need. Keep in mind that you can do just as much damage with this as you can in the Terminal as root.
To end your root Finder session, go back to the Terminal window and hit ^C.
Quirks to be Mindful Of
- You won’t be able to interact with any files you might have on your desktop, as those belong to your logged-in user account and root’s desktop is currently (and transparently) sitting on top of it.
- If you take any screenshots, they will be owned by the logged-in user and you’ll need to navigate to them via your root Finder window.
- If you attempt to open/double-click a file which requires root access to read, the corresponding application will open as the logged-in user and the file will fail to open. To get around this, you can launch the app’s /Contents/MacOS executable as root and open the file from within the app.