≡ Menu

check the failed login attempts in log file

Under Linux operating system you can use the faillog command to display faillog records or to set login failure limits. faillog command displays the contents of the failure log from /var/log/faillog database file. It also can be used for maintains failure counters and limits. If you run faillog command without arguments, it will display only list of user faillog records who have ever had a login failure.
[click to continue…]

Linux How do I display failed login attempt?

/var/log/faillog is a log file for failed login attempts. This file maintains a count of login failures and the limits for each account. The file is fixed length record, indexed by numerical ID. Each record contains the count of login failures since the last successful login; the maximum number of failures before the account is disabled; the line the last login failure occurred on; and the date the last login failure occurred. Since data is in binary format you need to use faillog command to display failed login attempt.

How do I use faillog?

To display failed login attempt for user root with following command:
$ faillog -u root
Output:

Login       Failures Maximum Latest                   On
root            0        0   02/17/06 14:49:52 +0530  tty1

To display all failed login attempt try:
$ faillog -a
Output:

Login       Failures Maximum Latest                   On
root            0        0   02/17/06 14:49:52 +0530  tty1
rocky           0        0   02/27/06 22:05:03 +0530  tty1
usr1            2        0   02/16/06 15:05:01 +0530  tty2

See also: