Forrest logo
tool overview
On this page you find all important commands for the CLI tool lastb. If the command you are looking for is missing please ask our AI.

lastb

The command line tool "lastb" is a utility in Unix-like operating systems that displays the most recent failed login attempts recorded in the system's lastlog file. It provides administrators with a convenient way to monitor and analyze unsuccessful login attempts.

  1. The "lastb" command stands for "last bad" or "last blocked," indicating that it specifically focuses on failed login attempts.
  2. It displays the username, terminal, source IP address, and the time and date of each failed attempt.
  3. The lastb command reads the data from the binary lastlog file, which keeps track of previous login activity.
  4. It allows system administrators to identify potential security threats and take appropriate actions to prevent unauthorized access.
  5. The output of the lastb command can be sorted, filtered, or further processed using various command line options and tools.
  6. The utility requires superuser or root privileges to execute, as it reads sensitive login information.
  7. By reviewing the information provided by lastb, administrators can investigate suspicious login attempts, detect patterns or anomalies, and strengthen overall system security.

List of commands for lastb:

  • lastb:tldr:3ad35 lastb: Show a list of all logged in users at a specific time.
    $ sudo lastb --present ${hh:mm}
    try on your machine
    explain this command
  • lastb:tldr:5fd20 lastb: Show a list of all last logged in users and translate the IP into a hostname.
    $ sudo lastb --dns
    try on your machine
    explain this command
  • lastb:tldr:96524 lastb: Show a list of all last logged in users until a given time.
    $ sudo lastb --until ${YYYY-MM-DD}
    try on your machine
    explain this command
  • lastb:tldr:e4093 lastb: Show a list of all last logged in users.
    $ sudo lastb
    try on your machine
    explain this command
  • lastb:tldr:edd17 lastb: Show a list of all last logged in users since a given time.
    $ sudo lastb --since ${YYYY-MM-DD}
    try on your machine
    explain this command
tool overview