HomeHow ToHow to Lock Your Mac Using Terminal

How to lock your Mac using Terminal

One of the first rules of cybersecurity is to always lock your computer before you walk away from it. While it may not be the quickest way, you can lock your Apple Mac using Terminal. Here's how you can do it.

How to lock your Mac using Terminal

Require a password to unlock your Mac

The command to lock your Mac using Terminal doesn't actually lock it. Instead, it just puts it to sleep. To be considered a "lock," a password must be required to access the Mac.

To password protect your Mac after it goes to sleep, click the Apple icon in the upper- left corner of the menu , then choose “System Preferences.”

How to lock your Mac using Terminal

Here, click on “Security & Privacy”.

Mac

On the “General” tab, select the checkbox next to “Require Password”.

How to lock your Mac using Terminal

Enter your password, then click the arrows next to “Require Password” to open the drop-down menu. You can then choose how long it takes before a password is required. Choose “Immediately” to lock your Mac immediately.

Mac

With this enabled, your Mac will lock immediately every time it goes to sleep.

Lock your Mac using Terminal

To lock your Mac via Terminal, you first need to boot up. Press Command+Space to open Spotlight Search. Type “Terminal” in the search bar, then click it when it appears in the search results.

Mac

In Terminal, type the following command, and then press Enter:

Mac
Mac

Your Mac will now be in sleep. If you set the option to require a password to wake it, then it is locked properly.

Information source: howtogeek.com

📧
Subscribe to the SecNews Newsletter

The most important Security & Technology news in your Inbox.

Teo Ehc
Teo Ehchttps://www.secnews.gr
Be the limited edition.

SEARCH

FOLLOW US

📧
Newsletter SecNews
The most important Security & Technology news in your inbox.

LIVE NEWS