In Mac OS X, if I don't touch it for a while, it will lock the screen and one must use password to unlock it, but this kind of log in is not recorded by last command. I want to know if anybody tried to break into my MacBook when I am not in front of it. Is there any way I can log such attempts?
If you suspect that someone has correctly guessed your password and got in, you can check this via the
Click on 'Diagnostic and Usage Messages' on the left panel. At the time of the correct login attempt you see something like this:
Note: 'screen locked, user typed correct password'.
Now if someone tried, yet failed, you'd see something like this under
I hope that's of some assistance to you.