MacOS – How to lock screen of host machine with TDM on Sierra

macosscreen-lockSecuritytarget-display

I regularly use my iMac as an external display for my macbook using target display mode (TDM). Since upgrading my iMac to Sierra, the screen locking behavior has changed in a disturbing way. I'm hoping there's a configuration flag I can set to revert to the old behavior. Here's the situation:

  1. I unlock the iMac. (log in to my account)
  2. Connect the two macs with thunderbolt.
  3. Hit command-f2 to enable TDM. iMac is now an external monitor for macbook.
  4. Use the macbook for a while. Lock the screen, walk away. Wait a long time.
  5. Unplug the thunderbolt cable.
  6. The iMac is logged in and unlocked. (!!)

Previously (before Sierra) on step 6, the iMac would have its account locked, which is of course what I want my mac to do if I haven't been using it in a long time.

How can I get my iMac to lock its account when it's being used as an external monitor in TDM mode? Right now, it seems using TDM is a major security hole for the iMac.

Best Answer

This should not happen at all if your iMac locks itself after a period of time without TDM.

To lock your iMac's account after a period of time, follow these steps:

  1. Choose Apple menu > System Preferences, click Security & Privacy, then click General.

  2. Click the lock icon to unlock it, then enter an administrator name and password.

  3. Click Advanced.

  4. Select “Log out after... minutes of inactivity.”

  5. Set the amount of time before the user is automatically logged out.

(quoted from https://support.apple.com/kb/PH18670?locale=en_US)

.

It definitively is supported to log out a user while using Target Display Mode (TDM):

Any apps that are open on your iMac remain open and active while your iMac is in Target Display Mode. (...)

If you've set your iMac to automatically log out, apps are paused or closed when this happens but your iMac remains in Target Display Mode.

From: https://support.apple.com/en-us/HT204592#options

.

Also check these options in System Preferences:

  • Energy Saver > Wake for network access (uncheck)
  • Security & Privacy > General > Require password immediately after sleep or screen saver begins (check)
  • Desktop & Screen Saver > Screen Saver > Start after: 1 Minute

Please let me know if this solves the issue.

Related Question