Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On Windows you can hit the keys Windows+L to lock your computer if you step away.

I don't want to have to remember if sleep currently asks for a password, if there is a time out where my screen isn't locked during a short period. Even with Lion supporting resume of many apps, I don't want to log out.

I do want to be sure data is secure when stepping out for lunch or a smoke break.

share|improve this question
I hope you've quit by now :) – Milo Aug 21 '14 at 3:57

23 Answers 23

up vote 158 down vote accepted

++ puts the display (only the display, not the whole computer) to sleep and will then prompt you for a password if you have enabled Require password [amount of time] after sleep or screen saver begins under System Preferences > Security.

If your Mac does not have an (eject) key, you can use ++ (power).

share|improve this answer
I like it! I think this is the closest to what I was looking for. – longda Aug 18 '10 at 17:12
I've tried the various methods listed here and on the net. Shift-Ctrl-Eject gets my vote for the easiest for people coming from Windows. – kbyrd Apr 14 '11 at 14:28
What if you have a Mac without an optical drive and no eject button? i.e. MBA 2011 – cspray Aug 20 '11 at 17:05
@cspray - CTRL + SHIFT + POWER BUTTON – 1.21 gigawatts Jan 12 '13 at 3:35
Caution! Preferring any amount of time will leave displays unlocked for at least part of that time. If the wish is for an immediate lock of displays, then the Security pane of System Preferences must be set to require a password immediately after sleep or screen saver begins. Please see the bountied answer. – Graham Perrin Jul 23 '14 at 6:53

From my answer in Super User.

Using Keychain Access's Lock Screen menubar.

Activate it here, in Keychain's Preferences:

keychain preference

Then lock.

keychain menubar

share|improve this answer
You can also create a Keyboard Shortcut for this in the Keyboard Preference Pane once the menu item is made available! – Chealion Aug 17 '10 at 21:10
Awesome, I'd never seen this before. – Scottie Aug 17 '10 at 21:10
That's exactly how I do it. I am surprised that their isn't something like this "out of the box". – Bruce McLeod Aug 17 '10 at 22:39
This one looks pretty good... how do you setup the keyboard shortcut for it though? – longda Aug 18 '10 at 1:50
@longda: Go to the Keyboard Preference Pane, and go to the Keyboard Shortcuts section. Add a new Application Shortcut with the menu name of Lock Screen. ( – Chealion Aug 18 '10 at 15:01

Via the Expose system preferences panel you can set a "hot corner" of your monitor that activates your screen saver. Say you set the Bottom Left corner, as soon as you move your mouse there the screen saver will invoke. If you've set a password on it, bingo, done.

Yet another option is to enable Fast User Switching in the Login Options pane of the Accounts preferences panel. This puts a Users menu in the top right hand corner, from which you can quickly choose "Login Window...". This kicks you to the login screen, requiring a password to move away from, and also does not end your session/quit any running apps.

share|improve this answer
This will piss off anyone who uses your computer that isn't used to that configuration. – Kendall Hopkins Sep 1 '10 at 1:12
This would be individually configurable between user accounts, though, I'm assuming. If you've got multiple users using the same user account, though, then yeah you'd have to take that into consideration for sure. – Scottie Sep 1 '10 at 11:50
@KendallHopkins shouldn't anyone using your computer be in their own account? :-) – Josh Jan 6 '12 at 15:00
Note that you do have a few seconds to move your mouse out of the corner without getting a password prompt. So it isn't as instantly as the original poster asked. – gpvos Jun 24 '13 at 8:54
I use hot corner it takes a nano-second if I want to walk away and not have anyone be able to access my laptop – gracey209 Sep 28 '15 at 0:44

Logging out to the fast user switching screen

  • Run /System/Library/CoreServices/Menu\ Extras/ -suspend.
  • Enable the fast user switching menu from the Users & Groups preference pane and then select Login Window… from the menu.
  • Use the lock action in Alfred.

Locking the screen

  • Check "Require password immediately after sleep or screen saver begins" in the Security & Privacy preference pane. You can then lock the computer manually by pressing control-shift-eject to turn off displays or option-command-eject to go to sleep. A power key can be substituted for eject in 10.8 and later. In 10.9 and later, you can also put displays to sleep by running pmset displaysleepnow.
  • Enable the Keychain menu extra from the preferences of Keychain Access and then select Lock Screen... from the menu.
share|improve this answer
I really like how this avoids the whole screensaver needing to enforce a password or a log out dialog popping up slowly to allow a cancel of a "log out" event. – bmike Sep 21 '11 at 16:46
@bmike I edited the answer to summarize other options (besides a shortcut for GCSession -suspend). – user495470 Sep 21 '11 at 20:16
Much appreciated. I hope you don't mind my edits and calling attention to this answer/question. (I hope you didn't feel compelled to make this into the combined answer - you're getting the bounty for the short/sweet answer once my 20 hour waiting period to award it expires.) Thanks! – bmike Sep 21 '11 at 20:23

With the track pad, you can configure gestures for locking your mac. I do it with a four finger swipe left. To confiugre this, you need a (free) tool like the BetterTouchTool.

share|improve this answer
In my opinion, that's actually the best answer ! – Cedric H. Sep 21 '11 at 21:51
And it should be noted that this is not restricted to the trackpad: you can set a shortcut for your magic mouse, normal mouse, or more simply for the keyboard. You can even configure the apple remote ! – Cedric H. Sep 21 '11 at 21:53

Use a keyboard shortcut and use Automator to make a screen lock service. This will allow you to set any keyboard command you would like to lock or start a screen saver on your mac. As referenced below is a nice article on how to do the process.

Handy screen locking tips for Mac

... If mousing to part of the screen isn’t your thing, you can use the keyboard to lock the screen, but it takes Automator (or a third-party application, but Automator is the better bet if you’re using OS X 10.6). Launch Automator and create a new service.

Tell the new service that it receives “no input” (rather than the default of “text”). The default is also for “any application”, make sure to keep this set. Next, drag the Start Screen Saver action from the Utilities action group to the workflow. Finally, save the service and give it a name, such as Start Screensaver. Go back to Keyboard Shortcuts in the Keyboard section of System Preferences and look in the Services group. Scroll down to the General section and you will see the newly created Start Screensaver service is enabled. Click in the whitespace to the far right of this entry and a new entry box will appear. Type the keyboard shortcut, such as CTRL-OPT-L.

Exit System Preferences.

Mac keyboard preferences

You will now be able to hit CTRL-OPT-L and activate the screen saver in order to lock the screen. If you wish to return to the login window instead (you are still logged in, but the computer is locked) rather than activate the screensaver, change the Automator service to Run Shell Script instead of Start Screen Saver and have it run the following command:

/System/Library/CoreServices/Menu\ Extras/ -suspend


share|improve this answer
Best answer, hands down. – Dan Moulding Jun 5 '12 at 16:49

Your Mac can ask your password after it wakes up if you set it to do so in the Preferences panel (Security). From there on, you can use ++ to put your Mac to sleep. So all you have to do is hit that and walk away.

share|improve this answer
Note: This invokes sleep, which is not good if you're processing stuff in the background. – r00fus Sep 21 '10 at 23:08

If you enable screen locking within the screen saver pref pane you can put the computer to sleep and lock at the same time by pressing ++F12

share|improve this answer
This isn't working for me... I have a screen saver setup and the required login when waking from a screen saver. Did I miss something? – longda Aug 18 '10 at 1:39

+++Q will perform a "quick logout."

Another option is to enable a password when waking from sleep or screen saver and adding a hot corner for one or the other. Then locking is as simple as tossing a mouse in a corner.

share|improve this answer
That command actually quits all running programs and logs the user out, which is likely not the desired behavior. edit: in regards to Shift+Cmd+Opt+Q – Scottie Aug 17 '10 at 20:10
@Scottie: Come on, give me more then a few seconds. – Josh K Aug 17 '10 at 20:10
This will logout instead of locking. Although it will still require a password to return, you lose the session. – Jacob Gorban Aug 17 '10 at 20:10
@Jacob: You're not reading "the other option" for this. – Josh K Aug 17 '10 at 20:12
The hot corner is a great quick way to do it. There are one or two pranksters in my office; flicking to the hot corner restricts their options to the old sticky tape on the mouse sensor trick, rather than changing acceleration curves or inverting colors etc... – Adam Eberbach Jan 15 '14 at 6:08

If you want to be able to remote control your Mac (with Synergy or something similar) even when it's locked, I'd recommend you to show the Keychain Status in the Menu Bar. You do that as follows:

  1. Launch the application Keychain Access
  2. Press ⌘, to open up the Preferences window
  3. Tick the Show Status in Menu Bar check box
  4. Click the newly appeared lock icon in the menu bar
  5. Click Lock Screen to lock the screen

This will lock the screen with a login window, but still make the Mac possible to remote control. If you don't need to remote control the Mac, MacLoc is a simple and effective solution.

share|improve this answer

The Lock Screen 2 app is a great little tool to make locking and unlocking much more adaptable. It is for sale on the app store priced below $5 lately.

The promo video is quite entertaining even though it doesn't promote the ease of assigning a custom key command to engage a screen lock.

share|improve this answer
You can use your trackpad to unlock. One problem. You can't set a password yet. – BinaryMisfit Sep 22 '11 at 9:09

If you're using Alfred, just invoke Alfred and start typing "lock". I don't remember if it's activated by default, but if not, you can activate and change the keywords in the Alfred preferences.

enter image description here

share|improve this answer

Deskshade does exactly what you are asking. It locks the screen displaying only a huge padlock sign so intruders know the screen is locked which prevents unnecessary attempts to use the machine whiles you are away.

share|improve this answer

Another program that can allow you to quickly lock your screen is Padlock. Note that the aforelinked Macworld review of Padlock also gives a comprehensive review of other solutions (many of which were discussed above) for locking your Mac.

share|improve this answer

SizzlingKeys is a little Preference Pane that mostly lets you configure iTunes keyboard shortcuts, but one of the "Extras" included lets you specify a shortcut to actually lock the computer and take you to the Fast User Switching screen, not just start the screensaver. I keep Lock configured as ++L but you can specify whatever you want.

SizzlingKeys has a paid upgrade, but the Lock shortcut is configurable using the free version.

share|improve this answer

FTW! A keyboard short cut to launch screen saver which you can configure with a password lock. All free. Follow the link for better explanation and screens. I have been using quicksilver to launch the screensaver which works nicely as well.

The only thing left to do is to define a keyboard trigger. I’m using “Shift/Control/Command-L” as my trigger.

This key combination may sound a bit awkward at first, but I’m using “Shift/Control/Command” for all my Quicksilver trigger. The nice thing about this combination is that it rarely cause conflicts with other keyboard shortcuts, and once you are used to this combination it’s really not this bad. So in this case I combined it with the letter “L”, for “Lock”.

share|improve this answer

To lock your screen using a apple keyboard try this enter image description here

Or do this by going to "System Preferences" then "Security" under "General"enter image description here

share|improve this answer

enter image description here

Go to settings -> Mission control and then over to HotCorners on the bottom left corner.

enter image description here

There are 4 corner setting appearing there. Choose anyone of them according to your feasibility as put to sleep. Just by dragging the mouse to that corner will put it to sleep and lock your system. I guess thats the best easy shortcut i have discovered.

share|improve this answer

Here is a good tutorial which will help you to create a short cut keys to lock your mac machine

Lock Screen Service

1. Launch Automator from your Applications folder.

2. Select Service as the document type.

3. Select Utilities from the list on the left, then double-click Run Shell Script in the next column.

enter image description here

4. On the top-right side of the screen, adjust the drop-down menus so the statement reads: Service receives [no input] in [any application]

5. Copy the following command into the large text box that appears:

/System/Library/CoreServices/"Menu Extras"/ -suspend

enter image description here

6. Go to File > Save and name your service Lock Screen. Once saved, you can now quit Automator.

Lock Screen Keyboard Shortcut

1. Launch System Preferences and go to the Keyboard pane.

2. Next, select the Keyboard Shortcuts tab. From the list on the left, select Application Shortcuts. Click on the plus (+) button below to add your new shortcut.

3. In the dialog box we’ll want to leave All Applications selected in the first menu. Enter Lock Screen as the Menu Title. Please note this has to be exactly the same name you entered when saving the service in Automator. Finally, enter your keyboard shortcut. Let’s go with Command+Option+Shift+L.

enter image description here

4. Click Add and you’re all done!

Now when you press your keyboard shortcut (Command+Option+Shift+L), the Mac login screen will immediately be displayed. You’re still technically logged in and processes such as large downloads will continue in the background. But you can leave your Mac unattended without worry – no one will be able to access your account until you enter your password. When you do, everything on your desktop will be there just as you left it!

share|improve this answer
Answers on Ask Different need to be more than just a link. It's okay to include a link, but please summarize or excerpt it in the answer. The idea is to make the answer stand alone. – patrix Jan 17 '14 at 11:51
Now explained my answer – Inder Kumar Rathore Jan 18 '14 at 5:11

You guys should check out QuickLock to lock your Mac with. It locks with any desired keyboard shortcut, it's beautiful, and it's completely and totally customizable.

Best of all it's free.

Check it out here:

share|improve this answer
If you are in any way affiliated with this app, please mention it in the answer. – patrix Oct 23 '12 at 3:31
Promotion is okay, but you need to clearly state that you are affiliated. See our FAQs – daviesgeek Oct 24 '12 at 5:54
To me, this looks like advertising – myhd Oct 30 '12 at 14:56

Lock Me Now - a Free app. Found it great for myself after searching and trying various options. Nothing redundant, just all-you-need-out-of-the-box:

  • Lock your screen
  • Set a global shortcut
  • Unlock with just a password

P.S: I'm not affiliated with this product.

share|improve this answer

I've used Salute for years - works beautifully. A nod to Windows' three finger salute - ++ gives you quick access to screensaver (set a password on the and your done) - terminal or activity monitor. It's no longer actively developed but doesn't need to be - worked great on Leopard through Mavericks.

share|improve this answer
That's neat that it works for terminal... that was another question I had asked on here too! – longda Jan 17 '14 at 22:14

You have some app on the App Store who provide you a lot of way to lock your Mac.

Like this one :

Or this : [Lock and unlock your Mac with your iPhone bluetooth]

share|improve this answer

protected by patrix Jan 17 '14 at 21:02

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.