How To Clear or Remove Linux Logins History
—
On Linux systems, there are three standard commands that show information about the most recently connected users: last, lastb and lastlog.
The output of these commands includes: login, time of last connection , IP address, port, etc.
To preserve anonymity, it is necessary to clear the history of recent connections.
Command | Log | Description |
---|---|---|
last | /var/log/wtmp | Lists successful login/logout history |
lastb | /var/log/btmp | History of failed login attempts |
lastlog | var/log/lastlog | List of the last connected users |
Also a popular request is how to clear the lastlog file in linux history.
For removing all the information about the last logged in users, you need to clear the logs:
For removing all the information about the last logged in users, you need to clear the logs:
# echo > /var/log/wtmp
# echo > /var/log/btmp
# echo > /var/log/lastlog
# echo > /var/log/btmp
# echo > /var/log/lastlog