Require Password Immediately After Sleep or Screensaver
Use sysadminctl -screenLock immediate to lock the Mac as soon as the screen saver starts or the display sleeps.
Run `sudo sysadminctl -screenLock immediate -password -` (enter your admin password when prompted) to demand the login password instantly on wake.
01Command
Command
$ sudo sysadminctl -screenLock immediate -password -02What it does
By default macOS can be set to allow a grace period before asking for the password; 'immediate' removes it so the screen locks the instant the display sleeps or the screensaver kicks in. This is the command-line equivalent of System Settings > Lock Screen with the delay set to 'Immediately'. The `-password -` syntax makes sysadminctl prompt securely instead of taking the password as a visible argument. Use `-screenLock off` to revert.
03Risk
!Warning: With 'immediate', the screen locks the moment it sleeps — anything unsaved on screen is behind the login prompt when you return.
04Undo
Undo
$ sudo sysadminctl -screenLock off -password -05Sources
- sysadminctl — change system settings and user accounts (macOS man page)Evidence: Documents `sysadminctl -screenLock immediate|immediate-password|off` to control whether the login password is required when the screen saver starts.
- Require a password after waking your MacEvidence: Explains the lock-screen requirement being tied to screen saver/display sleep timing and how it protects the Mac when left unattended.
Last verified: 2026-09-18 · Category: Security & Privacy