Screensaver password enabled by default in Yosemite. Not good for lab environment.

denmoff
Contributor III

I'm trying to disable the "Require Password" after sleep or screensaver begins. This is set by default with Yosemite and it's creating an issue for our lab computers as some students will forget to log off when they're done which leaves the screensaver password dialog box for the next person that sits at the station.

I've tried importing custom settings for a config profile for the device (and the user) and it is not working properly. The setting com.apple.screensaver should be the setting. askForPassword should be the key to set to 0 but it does nothing. Setting the key askForPasswordDelay seems to be taking tho. So, i'm setting that at very high number, but that's not really the solution i'm looking for. Anyone have luck actually disabling the "Require Password" option?

Here's what i'm importing as a custom profile:

<dict>
    <key>askForPassword</key>
    <integer>0</integer>
    <key>askForPasswordDelay</key>
    <real>18000</real>
</dict>
8 REPLIES 8

alexjdale
Valued Contributor III

Have you tried using a boolean with a value of False instead of an integer of 0 for the "askForPassword" key? I say this because I built a profile for the opposite recently with Profile Manager, which put in a <true/> instead of an integer.

<dict>
    <key>askForPassword</key>
    <false/>
</dict>

denmoff
Contributor III

I have. However, when i imported it, it turned it into a 0 in the config profile.
Edit: I'm sorry...when the profile is sent to the Mac, it turns it into a 0. Still doesn't affect the "Require Password" check box, it remains checked.

alexjdale
Valued Contributor III

"False" does work, I tested it with a manual config profile that I installed with the Profiles command. The issue here is that Apple's handling of that setting is *really* flaky. I had to clear out another profile we used to set it as "True" then reboot before installing the "False" profile. It really wanted to stay checked.

RobertHammen
Valued Contributor II

I've seen the flakiness with this setting and config profiles, and wrote my own launchd/script combo.

Since it's a launchd, the script runs as the user and applies that setting for the user. User may be able to go change the setting (askForPassword/askForPasswordDelay), but the next time they log in, the script runs and sets default values.

Let me know if you would like me to post the launchd/script here.

cpdecker
Contributor III

Is there any chance there's a configuration profile (Computers > Configuration Profiles > Security & Privacy) coming down that is changing this setting (Require password after sleep or screen saver begins)? Also, I do have at least one memorable instance where a configuration profile I have created ends up with information from a category it isn't configured to have once it makes its way to the Mac side. Do you see anything wacky under System Preferences > Profiles? Like Security & Privacy settings configured under a configuration profile that shouldn't have any?

jhuhmann
Contributor

@RobertHammen I'd like to see your login script for this if you don't mind.

adhuston
Contributor

I had a similar issue in one of our labs. I ended up using the following in a script at login:

LOGGEDIN=who | grep console | awk '{print $1}'
sudo -u $LOGGEDIN osascript -e 'do shell script "defaults write com.apple.screensaver askForPassword 0"'

Since the script was running as root, I tried using the standard:

su $LOGGEDIN defaults write com.apple.screensaver askForPassword 0

, but for some reason it didn't take. I ended up wrapping it in an AppleScript call, which for some reason seemed to work. I did find that preference caching seemed to take over and it would only take affect after a reboot. Hope this helps someone.

RobertHammen
Valued Contributor II

@jhuhmann posted it in another thread:

Discussion