Looking for a fast way to lock your Mac that works every time? Find out here how to lock the screen on a Mac with the macOS locking keyboard shortcut (or by just moving your mouse).
First, Where One Half Equals 18 Percent
A camera, when you let it, exposes any image for an average brightness of middle gray.
Just between white (which reflects some 95% of the light that hits it) and black paper (which reflects 3.5%), middle gray reflects 4… no, you guessed it: 18%.
Since brightness perception is not linear, 18% middle gray—the geometric mean between 3.5 and 95—has been accepted as a useful and happy middle.
Now, want to lock your Mac’s screen not 3.5%, not 18% but 100%? (You can also reduce its reflectivity to some 3.5%, of course.)
How to Lock the Screen on a Mac with a Keyboard Shortcut
Time needed: 1 minute
To lock the screen on your Mac immediately using a swift macOS locking keyboard shortcut:
- Press Command Control Q.
Not locking: Locking the screen only works when a login password has been set up for the account. The Guest User, for instance, never needs a password to log in to a Mac and cannot lock the screen.
Lock using the menu bar: You can also select the Apple logo () in the menu bar and select Lock Screen from the menu.
Using the mouse: Another alternative is locking the screen using the mouse; see below. - Select your account and type the account’s password to unlock the screen at any time.
Turn off the screen but not lock? Turn Off the Screen on a Mac (Without Putting It to Sleep)
Lock the Mac Screen Using a Screen Corner and the Mouse
To lock the screen on a Mac using a mouse gesture:
- Set up a corner for locking the screen. (See below.)
- Move the mouse cursor into that corner.
Mouse and keyboard shortcut: You can also set up the corner to only lock the screen if you hold down a key while you move the mouse to it to prevent accidentally locking your Mac.
Set up a “Hot Corner” to Lock the Mac Screen
To configure the screen to lock when you move the mouse cursor to a corner of the screen:
- Click the Apple symbol in the menu bar.
- Select System Settings… from the menu that has appeared.
- Go to the Desktop & Dock category.
macOS Monterey 12.0 and earlier: Open the Desktop & Screen Saver category and go to the Screen Saver tab. - Click Hot Corners….
- Select Lock Screen for the desired screen corner.
Keys: Hold down a function key set up a keyboard and screen corner combination. - Click OK.
How to Lock the Mac Screen with a Keyboard Shortcut: FAQ
Can I change the “Lock Screen” keyboard shortcut?
No, not easily.
While you cannot change the system-set keyboard shortcut for the Lock Screen command at all, you can set up a Terminal alias for locking the screen (see below), then create an alternate keyboard shortcut for invoking that command using Shortcuts or Automator. This is rather involved, though.
Can I lock the screen from Mac Terminal?
While no ready-made solution exists, locking the screen from a Mac Terminal is possible.
Two alternatives exist for screen locking:
- Put the display to sleep using
pmset
and set up your Mac to require a password immediately after sleep or screen saver activation (in System Preferences | Security & Privacy | General) - Set up a shell alias to have
osascript
mimic pressing the Command Control Q shortcut for you (note that this requires you to allowosascript
to control the Mac using keystrokes).
(How to lock the Mac screen with a keyboard shortcut tested with macOS Sonoma 14.3–14.6, Ventura 13.1 and Monterey 12.4; first published July 2022, last updated August 2024)