Terminal Dojo
Help العربية Sign inGet started

Command library / lastb

lastb

BashDraft — pending expert review3 practice missions

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 lastb

Usage

lastb [-n N] [-i] [-F] [username]

Options and flags

Examples

Common mistakes

lastb -N 20 lastb -n 20

Options are case-sensitive: the limit is a lowercase -n.

Related commands

lastwhojournalctl