Remove Login History on Server
On the Linux systems there are three standard commands that show the information about last logged in users:
The output of these commands include: login-name, last login time, IP address, port etc.
And sometimes, to keep anonymity, it is required to erase last login history.
To check the last login history, including the history of login attempts that failed, run one of the commands from the table below.
Command Logfile Description
/var/log/wtmp Lists successful login/logout history
/var/log/btmp Shows the bad login attempts
/var/log/lastlog Shows the most recent logi
You already how to check the last login history in Linux, so now it is time to learn how to clear it.
Clearing the Logs
As you can see from the table, the information about the last logged in users, including failed attempts to login, is stored in the specific binary files that you can’t edit but can easily empty them.
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
Now, you have removed all information about most recently logged users.
Was this answer helpful?
Enable browser caching to reduce website loading times, by taking advantage of caching of...
Reference this guide for help with mass find and replace file manipulation in Linux servers.Find...
This article explains the process of binding multiple IP addresses to the Network Interface Card...
This article explains the method of changing the root password on a Linux Server using SSH. SSH...
This article will provide the steps to disable Network Manager in CentOS 6. Network Manager is...