Saturday, January 2, 2010

Remove or clear the last login information in Linux

How to clear last login information in Linux?
Login information is stored in /var/log/lastlog
Deleting the contents of the file will remove the login information.
/var/log/lastlog is a binary file so opening it in an editor will show junk.
To read the contents of the file use lastlog

[praneeth@inferno ~]$ lastlog

Root permissions are needed to clear the login information.
Overwriting the /var/log/lastlog file is enough to clear the information.
[root@inferno ~]$ cat > /var/log/lastlog
CTRL+D

No comments:

Post a Comment