Oops… was that file important?

(Mac users only) Have you messed up an important system file that prevents you from running sudo to fix them? Or have you accidentally trashed some system files from the Finder that have broken the authentication system (that asks for your password when doing certain privileged operations)? Macs have two different systems for managing delicate operations — the system that powers the underlying UNIX-y bits and the stuff for nice Mac-y applications. The upshot is that you can sometimes perform brain surgery on your computer without any anesthetic: some problems can be fixed without rebooting into single-user mode.

If you’ve trashed a Mac-y file (e.g., Security.framework), you can still use sudo in /Applications/Utilities/Terminal.app. Conversely, if your sudoing abilities have been compromised, use the Finder to replace files and something like TextWrangler that uses Mac frameworks to edit system files. I accidentally corrupted my /etc/sudoers file a few weeks ago and quickly fixed the problem sans reboot when I realized TextWrangler could still edit system files.

Bonus tip: I always have both Terminal.app and X11.app installed on my Macs. Sometimes, one of them stops working (the joys of a dying hard drive). So far, they have never both failed on me at the same time, so I can use the working one to resuscitate the other.

Leave a Reply

Your email address will not be published. Required fields are marked *