Command library / lastb
lastb
Show failed login attempts
The failed-login counterpart of last: it reads /var/log/btmp, where the system records every rejected login attempt, and prints which account was tried, from where and when. A burst of failures against one account, or from one address, is the classic sign of password guessing. It needs root, because btmp is readable only by root.
Practice lastbUsage
Options and flags
usernameshow only failed attempts against this account
-n, --limitNshow only the last N entries
-i, --ipshow the source as an IP address instead of a host name
-F, --fulltimesprint full dates and times, including the year and seconds
Examples
lastb -n 20The 20 most recent failed login attempts.
lastb adminEvery rejected attempt against the admin account.
lastb -iFailed attempts with each source shown as a numeric IP address.
Common mistakes
Options are case-sensitive: the limit is a lowercase -n.