Disabled screen lock on macOS
Is there a way to disable the default behavior for macOS (10.13/10.14) of locking the screen x-amount of time after the screensaver or sleep begins?
I have some Mac Minis in a computer lab. People log in, use the computer and then walk away. MacOS locks the screen an hour later when the power settings turn off the monitor. The next user is unable to log in because the screen is locked and there is no option to enter a username for switching or any other purpose. All that's there is a password dialog. The only recourse is to forcibly reboot the Mac.
The ultimate solution would be to have an application that forcibly logs-out idle users, but there are none that I can find.
MacOS appears to have a provision for doing so, but it doesn't appear to actually do anything: If the user has any application open which prompts for a save command upon termination, the logoff will not occur, and users always have programs open that prompt for saving. If I had the skills, I would write such an application but I do not.
I've tried running: sudo defaults write com.apple.loginwindow DisableScreenLockImmediate -bool TRUE
Does nothing. There is no change. The default screenlock is still active and enabled and the Lock Screen menu choice is still available on the Apple menu.
The timeout is controlled in the Security and Privacy
panel in System Preferences
. What you are looking for is on the General
tab and sets the time before requiring a password after the screen saver kicks in.
I have the same issue, and seems all the previous tricks no longer work on Mojave.
As to your autologout after X minutes, I believe you can still do that, with the script below (although I'm not sure I've actually tested it on Mojave). You can just push the script out using whatever method you like, and run it once. (Or you can just open a Terminal window, or ssh in, and run the command manually.)
autologoff.sh
#!/bin/bash
# I think this this turns on the feature
defaults write /Library/Preferences/.GlobalPreferences com.apple.securitypref.logoutvalue -int 1800
# and that this sets the delay
defaults write /Library/Preferences/.GlobalPreferences com.apple.autologout.AutoLogOutDelay -int 3600
# 3600 = 60 minutes
# 1200 = 20 minutes
# 750 = 12 minutes
# 600 = 10 minutes
# 500 = 8 minutes
# etc
# (I suspect one of these can simply be a non-zero value,
# and that the Apple OS programmers just plugged in
# the value given by the user instead of making it a
# binary 0 or 1 value, but I’m not sure.