Require a password on waking from sleep, but not when screensaver is active

Apr 26, 2009 - 9 Comments

Have you ever wanted to have your Mac require a password on waking from system sleep, but not ask for a password when the screensaver is on or the screen was locked? Well, me neither, but someone out there might and it’s kind of a nifty customization tip. Here’s how to do it:

Launch the Terminal from the /Applications/Utilities directories, and type the following defaults write command:

defaults -currentHost write com.apple.screensaver askForPassword -int 0

Reversing this should just be a matter of changing the 0 to a 1

defaults -currentHost write com.apple.screensaver askForPassword -int 1

Screen saver with no password

I came across this nice trick on TUAW that I thought it was worth reposting here to our readers.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Bill Ellis in Command Line, Customize, How to, Screensaver, Tips & Tricks

9 Comments

» Comments RSS Feed

  1. Martin says:

    The string with 0 (zero) unchecks the option for asking a password completely (in my OSX v10.5.6). So after after ending the screensaver as well as awakening from system sleep, no password is asked.
    What can be wrong? I assume that the option should stay active?
    Thanks

  2. lukasz says:

    I have oposit situation.
    I used string with 0 (zero) and I have password protection in both action (scr saver and after awakening from sleep mode. It happened after first sleep mode cycle.

    Strange, verry strange.

    If somebody knows how and why, it will be nice to read it.

  3. Ced Paine says:

    This command toggles the “Require password to wake this computer from sleep or screensaver” preference and does not seem to result in a separate setting for just the screensaver. You can, however, use this command along with Bernhard Baehr’s sleepwatcher script to toggle this preference on when the computer sleeps and off again when it wakes. Just install sleepwatcher and place the appropriate commands in files named .sleep and .wakeup at the root level of your home directory.

  4. Porno says:

    Password is the base of safety…

  5. poro gratuit says:

    you right like always.

  6. Eric says:

    This doesn’t seem to work with Snow Leopard anymore. Can someone confirm this or help me, please? ;)

  7. em says:

    The same problem, it doesn’t work anymore under Snow Leopard, as I remember in Tiger that could be easily set without tweeking in console

  8. osta cialis says:

    en the screensaver is on? Well, me neither, but someone out there might and it’s kind of a nifty customization tip. I came across this nice trick on TUAW that I thought it was worth reposting here to our readers.

    Launch the Terminal and type the following command:

  9. [...] Require a password on waking from sleep, but not when screensaver is active Require a password on waking from sleep, but not when screensaver is active [...]

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates