Posted on 02-19-2015 07:36 AM
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>
Posted on 02-19-2015 07:57 AM
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>
Posted on 02-19-2015 08:22 AM
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.
Posted on 02-19-2015 08:56 AM
"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.
Posted on 02-19-2015 09:53 AM
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.
Posted on 02-19-2015 09:56 AM
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?
Posted on 05-06-2015 12:00 PM
@RobertHammen I'd like to see your login script for this if you don't mind.
Posted on 05-06-2015 12:29 PM
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.
Posted on 05-06-2015 12:52 PM
@jhuhmann posted it in another thread: