On the Linux systems, there are three standard commands that show the information about the last logged-in users: last, last, and last log.
The output of these commands includes login-name, last login time, IP address, port, etc.
And sometimes, to keep anonymity, it is required to erase last login history.
Command | Logfile | Description |
---|---|---|
last | /var/log/wtmp | Lists successful login/logout history |
lastb | /var/log/btmp | Shows the bad login attempts |
lastlog | /var/log/lastlog | Shows the most recent login |
Remove Information About Last Logins
To remove all the information about the last logged in users, you have to clear the files where this information is kept :echo > /var/log/wtmp
echo > /var/log/btmp
echo > /var/log/lastlog