If you dig around a bit, you’ll find that /private/var/log/secure.log contains a record of your recent screen saver authentication activity. A typical snippet looks something like this:

Oct 6 19:46:51 Goliath com.apple.SecurityServer: authinternal failed to authenticate user matthew.
Oct 6 19:46:56 Goliath com.apple.SecurityServer: authinternal authenticated user matthew (uid 502).
Oct 6 19:46:56 Goliath com.apple.SecurityServer: uid 502 succeeded authenticating as user matthew (uid 502) for right system.login.screensaver.
Oct 6 19:46:56 Goliath com.apple.SecurityServer: Succeeded authorizing right system.login.screensaver by process /System/Library/CoreServices/loginwindow.app for authorization created by /System/Library/CoreServices/loginwindow.app.

So if anyone has recently failed at guessing your password, there should be a line containing the string “authinternal failed” (shown above), and assuming you had just stepped out for a little while, this line would have a recent time stamp and be toward the bottom of the log.

Here’s a quick one liner you can run in Terminal that will flag invalid login attempts for the current day. Wrap it up as a Bash script if you find it to be handy.


cat /private/var/log/secure.log | grep "authinternal failed" | grep "`date | awk {'print $2 "  " $3'}`"

In case you’re new the pipes and filters architecture, this is just a little three-part pipeline. It’s pretty simple, but you can check the man pages by typing man <command name> in Terminal or post back up a question if you want additional info. The only thing you may not have seen before is the command substitution that takes place with the grave accents. All that’s happening there is that the output of the command in the accents is replacing the command itself. The output that’s substituted back in for the command is what grep picks up and uses as a filtering criteria.

You should note that although our three-part pipeline does tell you about invalid attempts, it doesn’t tell you anything about valid logins (meaning that someone did successfully guess your password.) If you want to know about them, you’ll need to get a synopsis of the most recent activity. Taking the last 6 lines or so from the log file should be enough to tell if you if there has been any covert activity since your current login and when you stepped out to lunch.

cat /private/var/log/secure.log | tail -6

So back to that question…

…Ever had your screen saver hacked? (and are you sure)