Require a Password on Waking from Sleep, but Not When Screensaver is Active

Apr 26, 2009 - 9 Comments

iMac

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 that has some valid uses in some environments when a Mac at screensaver mode shouldn’t require a login, but waking from sleep should.

Here’s how to accomplish this rather unique login authentication requirement on a Mac:

Selectively Requiring Login Password on Mac Wake from Sleep, But Not Screensaver

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 which then changes the behavior requiring login authentication back to default.

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.

.

Related articles:

Posted by: Bill Ellis in Command Line, Mac OS, Tips & Tricks

9 Comments

» Comments RSS Feed

  1. […] 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 […]

  2. 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:

  3. 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

  4. Eric says:

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

  5. poro gratuit says:

    you right like always.

  6. Porno says:

    Password is the base of safety…

  7. 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.

  8. 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.

  9. 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

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

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

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site