How to Lock Your Mac Using Terminal


Mac Terminal App Icon

A single of the to start with regulations of cybersecurity is to constantly lock your computer system before stepping absent from it. Even though it may possibly not be the fastest way, you can lock your Apple Mac making use of Terminal. Here’s how to do it.

Require a Password to Unlock Your Mac

The command to lock your Mac using Terminal does not basically lock it. Somewhat, it just puts it to sleep. To be deemed “locking,” a password will have to be demanded to obtain a Mac just after it is been set to sleep.

To password-guard your Mac soon after it’s been put in sleep mode, click the Apple icon at the top rated remaining of the menu bar, and then decide on “System Preferences.”

Listed here, simply click “Security & Privacy.”

Underneath the “General” tab, select the checkbox up coming to “Require Password.”

Style your password, and then click on the arrows upcoming to “Require Password” to open the drop-down menu. You can then pick out the volume of time that ought to move ahead of a password is essential. Pick out “Immediately” to lock your Mac each time you put it to sleep.

With this enabled, your Mac will immediately lock when it is set to slumber.

Lock Your Mac Employing Terminal

To lock your Mac via Terminal, you first have to launch it. Press Command+Space to open up Spotlight Research. Form “Terminal” in the Lookup bar, and then click it when it seems in the search results.

In Terminal, style the pursuing command, and then push Enter:

pmset displaysleepnow

Your Mac will now be in slumber mode. If you chosen the selection to require a password to wake it, it is now also successfully locked.


Locking your Mac is a great way to avert unauthorized access to it, while nevertheless allowing for packages to run in the qualifications. If you’d somewhat kill all functions, you can also shut down your Mac by way of Terminal.

Associated: How to Lock Your Home windows 10 Personal computer Utilizing Command Prompt

Exit mobile version