Things definitely have changed:
⌥⌘⏏ (Cmd-Option-Eject) to put your machine to sleep no longer works in Sierra.
Supposedly, ⌃⏏ (Ctrl-Eject) has taken its place, but it doesn't work on my late-2012 iMac.
At least according to the documentation, that is the only change - compare below.
Sadly, you cannot bring the old shortcut back (at all?), because defining keyboard shortcuts in System Preferences > Keyboard > Shortcuts > App Shortcuts
doesn't allow you define shortcuts involving ⏏ (Eject), and, in fact, even shortcuts that are permissible do not seem to put the machine to sleep (flickers briefly, but stays awake).
Sleep-related shortcuts as of macOS Sierra:
Source: https://support.apple.com/en-us/HT201236
Sleep-related shortcuts as of OS X El Capitan:
Source (link effectively dead, redirects to the Sierra page): http://support.apple.com/kb/ht1343
There are different ways to lock your screen.
Note: These shortcut tips are for Sierra and below. In High Sierra, there is a new entry under the Apple Menu (with shortcut) to lock the screen.
1. Use keychain
Open keychain -> Settings. Choose from there Show keychain status in menu bar.
You can now choose from the menu bar to lock your screen.
With this option, you need your password to log in next time.
2. Use Hot Corners to lock your screen
First, go to your System Settings -> Desktop & Screen Saver and choose Hot Corners on the bottom right.
Next, choose one of the corners the option Put Display to Sleep. I prefer bottom right, but this is by each user different.
That's all. One note: You can configure in the Privacy Settings when the display will be locked. For example, if you have it set to five minutes, you need to enter your password after the time in your setting is gone. You can change this to immediately, for example.
3. Lock Screen (with Shortcut)
Because @Flimm asked for a shortcut to lock the screen, here is a solution below High Sierra.
Usually, there are two solutions. You can use CTRL+Shift+Power Button or
CTRL+Shift+Eject-Key to lock the screen.
Both solutions are not my favourites, and for that reason, I've created a Shell Script with Automator. Thanks to Taylor who gave me this hint.
- Open Spotlight and type Automator to open the Application.
- Create a new Document.
- Choose Service to make as global Service.
- On the left Pane, choose Utilities; and on the right column, double-click Run Shell Script. You see a Window with the Cat-Command.
- Delete the cat-Command and copy & paste the following Shell-Script into the empty Window:
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
Make sure that on the top right of the Automator-Window, both pull down-menus are set as no input in any application.
- Click on the top right to the Run-Button (marked with green circle) and test if it works.
- Save your workflow now as Lock Screen, for example.
- Open System Preferences, Keyboard and click on the Button Shortcuts or Keyboard Shortcuts.
- Choose on the Left columns Services and search for your saved workflow.
- Add your favourite Shortcut (e.g. I have Cmd + Alt/Opt + L).
For better understanding, I have put the pictures below.
Apple Support Documents Mac Keyboard Shortcuts
Best Answer
On my M1 MacBook Air, the following works: press Touch ID with any finger not registered with Touch ID to lock the Mac. Then press Esc to Sleep.