set askforpassworddelay in terminal using defaults

This defaults command is all over the web but is not working for me:
defaults -currentHost write com.apple.screensaver askForPasswordDelay -int 1800

This is probably because the XML tag for the askForPasswordDelay time us <real>.
<dict>
<key>askForPasswordDelay</key>
<real>60</real>
</dict>

I basically want to set the System Preferences/Security Password delay to immediately which would be:
<real>0.0</real>
Just not sure how to do it using the defaults command.

Thank you all! 😉

Support all Mac machines, Mac OS X (10.6.5)

Posted on Nov 16, 2010 10:40 AM

Reply
9 replies

Nov 16, 2010 11:35 AM in response to spraguga

AFAICT, the default setting for that item when initially setting the Security prefPane to require a password is 0.0, all I can suggest is to delete the plist and reset it. BTW, that plist is unique to each user. Here's mine:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>askForPassword</key>
<integer>1</integer>
<key>askForPasswordDelay</key>
<real>0.0</real>
</dict>
</plist>

See http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/PropertyL ists/Introduction/Introduction.html for more details.

Nov 16, 2010 1:19 PM in response to baltwo

The following will enable the security password and set the delay to immediately in OS X 10.6:
defaults -currentHost write com.apple.screensaver askForPassword -int 1
defaults -currentHost write com.apple.screensaver askForPasswordDelay -int 0

When I was testing in the terminal I was testing with sudo which doesn't work:
sudo defaults -currentHost write com.apple.screensaver askForPasswordDelay -int 0


Thanks again!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

set askforpassworddelay in terminal using defaults

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.