Login attempts and user connections to the system are tracked in the log files wtmp and btmp, but these files are in a binary format and are not directly readable like text log files. To access them, use the last utility. To get the most recent logins to the system (stored in wtmp):
last
To look in an older version of the file found in /var/log:
last -f /var/log/wtmp.1
To look at the most recent failed logins (stored in btmp):
sudo lastb
or
sudo last -f /var/log/btmp
(There are different permissions on btmp and wtmp, so looking at the failed logins requires a sudo, or running it as root.)
And to look at older btmp files to see older failed logins:
sudo lastb -f /var/log/btmp.1
or
sudo last -f /var/log/btmp.1
A quick scan through the output of last will tell you everyone who has logged in recently, and you can look for unauthorized or unexpected entries.
No comments:
Post a Comment