Apple OS X Lock Desktop / Screen

I need to prevent others using my desktop or laptop while I’m away from it. How do I lock my Laptop (Macbook or Macbook pro) / desktop using Mac OS X operating systems without using 3rd party applications?

You can lock your screen with password. First, you need to lock your computer screen:

  1. Open System Preferences, and then click Security.
  2. Select “Require password after sleep or screen saver begins.”
Fig.01: Locking your computer screen

Fig.01: Locking your computer screen

Keyboard Shortcut To Lock Your Desktop Screen

To put screen to sleep press [CTRL] + [Shift] + [Eject].

Menubar Shortcut To Lock Your Desktop Screen

Open Applications > Utilities > Keychain Access > Preferences >Select “Status in Menu Bar“.

Fig.02: Apple OS X Keychain utility

To lock screen click on Menubar lock symbol > Select “Lock screen

Fig.03: Locking the screen

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 18 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
18 comments… add one
  • Marcus Apr 6, 2011 @ 12:12

    You can use the default keyboard shortcut to to this as well.

    FN+SHIFT+CTRL+Eject button and it will lock the screen.

    • Ben Feb 1, 2016 @ 22:45

      Which button is “Eject”?

  • hormozan Apr 8, 2011 @ 4:00

    Mac OS is open source OS

    • TryME Apr 11, 2011 @ 18:17


      • Marcus Apr 11, 2011 @ 19:21

        Well, the core kernel (Darwin) is open source. But the OS X in it’s current form is def. not open source. And for every day that goes, it’s a bit less open.

        But I would still say, even if it pains me, that the core of OS X def. is open source.

  • Antony Mar 24, 2012 @ 20:17

    I use a Mac Air and I do not have an eject key. Any other way, maybe from command line?

    • 🐧 nixCraft Mar 24, 2012 @ 22:54

      What about Menubar option?

      • Antony Mar 25, 2012 @ 0:50

        Didn’t want to use the mouse:)
        Would be more interesting if I know the actual command that gets executed when “LockScreen” is clicked,

        • Erik May 11, 2012 @ 15:57

          From the command line, you can execute this to lock your screen:

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

          • allanon Sep 28, 2012 @ 23:44

            On the Air, It’s CTRL+SHIFT+POWER button

            • Calip May 7, 2013 @ 3:19

              This worked on my Macbook Pro 13.3 with Retina display.
              Thanks a lot !

            • Marnix Sep 4, 2013 @ 11:07

              Perfect! Thx!

              On the Air it’s CTRL+(RIGTH)SHIFT+POWER to be exactly.

  • Sat Jun 20, 2012 @ 12:18

    This is a great article, exactly what I was looking for.

    I am also looking for to make Macbook display as primary upon power failure. I use Dell monitor as primary and want to switch upon power failure to continue working with Macbook display.

    Any pointer would help.

    I appreciate for blogging.


  • Sat Jun 20, 2012 @ 12:31

    Exactly what i was looking for.

    My previous post didn’t appear so posting again.

    I am also looking for a keyboard shortcut key to make Macbook display as primary upon power failure.

    I am using Dell monitor as primary.

    Your blog helped me to find what I was looking for.


  • Sat Jun 20, 2012 @ 12:36


    I realised Fn key is unnecessary to lock screen.

    Ctrl + Shift + Eject key actually locks screen.

  • 🐧 nixCraft Jun 20, 2012 @ 16:41

    @Sat, we cache page for some time. So you will not see comments immediately.

  • Ph Jan 17, 2014 @ 12:55

    Mac mini user here. How do I lock mac mini with keyboard? I have apple keyboard. Thanks!!!

  • Sonia Feb 21, 2014 @ 15:49

    The best way to lock your mac screen quickly
    1.Search in the spotlight “Desktop & Screen saver”
    2.Go to bottom “HOT corners”
    3.Select screen saver and then move your cursor it will lock quickly (in that you have already activated the option “lock the screen immediately “)

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum