The Keychain

The information explosion of the computer age may translate into bargains, power, and efficiency, but as noted above, it carries with it a colossal annoyance: the proliferation of passwords we have to memorize. Shared folders on the network, Web sites, FTP sites—each requires another password.

Apple has done the world a mighty favor with its Keychain feature. (It’s an earlier, not-Internet-based version of the iCloud Keychain described on Saved Passwords: The iCloud Keychain.) Whenever you log into OS X and type in your password, you’ve typed the master code that tells the computer, “It’s really me. I’m at my computer now.” From that moment on, the Mac automatically fills in every password blank you encounter, whether it’s a Web site in Safari, a shared disk on your network, a wireless network, an encrypted disk image, or an FTP (File Transfer Protocol) program like Transmit or Cyberduck. With only a few exceptions, you can safely forget all your passwords except your login password.

All kinds of programs and services know about the Keychain and offer to store your passwords there. For example:

If you work alone, the Keychain is automatic, invisible, and generally wonderful. Login is the only time you have to type a password. After that, the Mac figures, “Hey, I know it’s you; you proved it by entering your account password. That ID is good enough for me. I’ll fill in all your other passwords automatically.” In Apple parlance, you’ve unlocked your Keychain just by logging in.

But there may be times when you want the Keychain to stop filling in all your passwords, perhaps only temporarily. Maybe you work in an office where someone else might sit down at your Mac while you’re getting a candy bar.

Of course, you can have OS X lock your Mac—Keychain and all—after a specified period of inactivity (Sharing Across Accounts).

But if you want to lock the Keychain manually, so that no passwords are autofilled in until you unlock it again, you can use any of these methods. Each requires the Keychain Access program (in your Applications→Utilities folder):

Whenever the Keychain is locked, OS X no longer fills in your passwords.

To take a look at your Keychain, open the Keychain Access program. By clicking one of the password rows, you get to see its attributes—name, kind, account, and so on (Figure 13-18).

By choosing File→New Keychain, you can create more than one Keychain, each with its own master password. On one hand, this might defeat the simplicity goal of the Keychain. On the other hand, it’s conceivable that you might want to encrypt all your business documents with one master password and all your personal stuff with another, for example.

If you do have more than one Keychain, you can view all of them by clicking the little Show Keychains button at the lower-left corner of the Keychain Access window; now you see a list of all your Keychains (including some maintained by OS X itself). Click their names to switch among them.

Keychains are represented by separate files in your Home→Library→Keychains folder. Knowing that can be handy when you want to delete a Keychain or copy it to another Mac—your laptop, for example. (Then again, the File→Export command may be even more convenient.)