Thursday, December 23, 2010

Remove Last Login Information in Linux

Linux holds all the log files in /var/log directory. You just need to find out which log file you require. Generally, two files hold the login information on a linux system-

lastlog
wtmp

cd /var/log/
rm -rf lastlog
rm -rf wtmp
touch lastlog
touch wtmp
chmod 644 wtmp (optional)
chmod 644 lastlog (optional)
exit

TOUCH command is used to create both the file with an empty content.
Setting permission to both the files are optional.