General Musing

blaze your trail

Mac Screen Saver Issue #security

with one comment

Apple Logo

Sometimes I need to use my computer to read things, as somebody who considers himself security conscious it means I need to have my finger at the ready as my computer turns on the screen saver after 3 minutes (180 seconds) and password locks it. However I do need to be able to read something without needing to be sure to interact with my HIDs. My old solution was to set my screensaver to lock after 15 minutes (900 seconds), however this poses a security risk as I can forget to lock my screen using the hot corner (see image) if I were distracted by something.

System Preferences - Screen Saver

So I needed a way to automatically reset the screensaver back to the 3 minutes after a grace period. OSX has a tool called default which allows changes to be made to the system settings, and it allows you to change the screensaver like this:


defaults -currentHost write com.apple.screensaver idleTime -int 180

Now the only time I really do this is at home, so I need my computer to be secure before I leave for work in the morning. I decided that 8:30 would certainly be a time that I would still be in the house and my Macbook would be open should I have forgotten to reset the timeout. So I first added this following line using crontab:


30 8 * * * defaults -currentHost write com.apple.screensaver idleTime -int 180

Naturally this is still not very secure, sure the effort is half way there, and it should really reset it more often. Perhaps I would want to set it every 15 minutes, which should give me a maximum grace period of 15 minutes. This would be unhandy in the evening when at home.


0,15,30,45 * * * * defaults -currentHost write com.apple.screensaver idleTime -int 180

Or every 15 minutes only for the period of time you are in an environment where you may not entirely control who has physical access to your machine. This could be on a customer site, at a conference or in a shared office space. Or at home while the kids are still awake.


0,15,30,45 8-21 * * * defaults -currentHost write com.apple.screensaver idleTime -int 180

This says between the hours of 8:00 and 21:45 I want you to set my screen saver to 3 minutes every 15 minutes.

Image source: me, Brian Solis

Written by Daniël W. Crompton (webhat)

September 22, 2012 at 8:25 pm

Posted in access, lifehacks, OSX, security

One Response

Subscribe to comments with RSS.

  1. Excellent post.I’m impressed.You’ve explained it well.Informative and helpful post.Thanks for sharing.

    fireplace video loop

    November 21, 2012 at 6:10 am


Leave a reply to fireplace video loop Cancel reply