Quickly lock your screen

If you work with any kind of sensitive material—from trade secrets to love letters—you’ve probably wished for a way to block access to your Mac the minute you stand up. There are many ways to do this, from the obvious to the obscure. I’ll cover all the methods I know to accomplish this trick. For most of these methods to work, you need to require a password when your Mac wakes from sleep or screensaver mode. To do this, open System Preferences, go to the Security pane, and select the Require Password to Wake This Computer From Sleep or Screen Saver option. Now you’re ready.

A simple way to protect your files when you walk away from your computer is to hit Shift-Command-Option-Q to do a fast logout of your user. Your Mac will go back to the login screen. However, there’s a huge downside to this method—all of your currently-open documents will close, and any running applications will quit prior to the logout. Clearly there must be better alternatives, and there are.

You could also put the computer to sleep. Go to the Apple menu and select Sleep or, if you’re using a laptop, press the power button and choose Sleep from the pop-up dialog. (Note: This is an edit from the originally posted version, where I said to hold the power button down; if you do that long enough, you’ll turn the computer off.) Of course, it takes a bit of time to put a Mac to sleep and to wake it up. You may also have remote users connected to the machine, or some lengthy program running that you’d rather not interrupt. In those cases, this isn’t the ideal solution.

A relatively quick method of locking your Mac—while still leaving your programs running—is to activate the screen saver using a hot corner . To do this, open the Desktop & Screen Saver System Preferences panel, activate the Screen Saver tab, and click the Hot Corners button. Decide which corner of your screen you’d like to use, then click the corresponding pop-up menu and select Start Screen Saver. Now when it’s time to walk away, just fling your mouse into that corner of the screen, and you’ll trigger the screen saver.

If you have the corners of your screen devoted to Exposé or some other feature, here’s another option. It turns out that the screen saver is just an application, so you can put an alias to it in an easy-to-access location, such as your dock, or the Finder’s sidebar or toolbar. Just navigate to System -> Library -> Frameworks -> Screensaver.framework -> Versions -> A -> Resources, and then drag ScreenSaverEngine.app onto your dock, sidebar, or toolbar. Now when you want the screensaver to activate, just click the convenient icon. The dock will prove the easiest spot to reach, since it’s visible in all applications. If you have a launcher program such as Peter Maurer’s Butler or Objective Development’s LaunchBar, you could even create a keyboard shortcut that will open the program for you, no mousing around required.

Another method of locking your system is to show the login window, without actually logging out. You can do this by enabling fast user switching in the Accounts System Preferences panel. Click the Login Options button (you’ll probably have to enter your administrator password to do this), and then select the Enable Fast User Switching option. Once you have fast user switching enabled, you’ll see either an icon or a name in your menubar, depending on what option you chose on the Login Options screen. Click on your name or icon in the menubar and select Login Window from the drop-down menu. The login window will appear. When you return to your Mac, login as you usually do. All your applications will be just as your left them—even your iTunes music will start up again where it stopped playing, even if that means mid-song.

But what if you don’t want to always lock your screen when the screen saver activates or your computer wakes from sleep? In other words, you don’t want to set that option in the Security pane as you must for the methods I’ve described so far. (After all, it can be a pain to have to enter your password over and over again throughout the day.) Keychain Access holds the key. You can use this application (in your Applications/Utilities folder) to quickly activate your screen saver from the menubar and require a password to turn it off—even if the Security pane option isn’t enabled. Open Keychain Access and then go to Keychain Access: Preferences. Click on the General tab and select the Show Status in Menu Bar option. A small lock icon will appear in your menu bar. Close the Preferences window and quit Keychain Access. Now click the lock icon in your menubar and choose Lock Screen to start your screen saver. You can even define a keyboard shortcut for the Keychain Access Lock Screen menu. First make sure the Lock Screen icon is the leftmost of your Apple-provided menubar icons. Hold down the Command key and drag the lock icon to the left edge of your existing icons, then drop the icon. This step is necessary to make this trick work. Now open System Preferences, and click on the Keyboard & Mouse pane. Click the Keyboard Shortcuts tab, and then click the plus sign to add a shortcut. Leave the pop-up menu set to All Applications, enter Lock Screen for the Menu Title, and then define a keyboard shortcut to use:

Here I’ve defined Shift-Control-F8 as my lock screen shortcut; this may seem an odd combo, but here’s why—since this is a keyboard shortcut for a menubar icon, it only works when that area of the menubar is active (“has focus”). Luckily, one of OS X’s pre-defined keyboard shortcuts is Control-F8, which moves the focus to the status menu area of the menubar, where the lock icon appears. When you hit Control-F8, the leftmost menubar status item will activate; that’s why this trick only works with the lock icon in the leftmost position. And since Control-F8 is the status menu activation key, I assigned a very similar keystroke for the Lock Screen function. So to lock the screen, hit Control-F8, and then Shift-Control-F8. Presto, the screen saver will activate! Note that this may not work for everyone, depending on what other menu extras you have installed. You should always be able to hit Control-F8 and use the arrow keys, however, which is almost as easy and still mouse-less.

I’m sure I’ve missed at least a few additional methods of quickly locking your screen; if you have one, please share it in the comments.

Shop Tech Products at Amazon