Last command : used to list information about users who are currently logged in to the system in the past. The information is saved in the/var/log/btmp file. You can do this by:
# True >/var/log/wtmp
To clear the record.
lastb Command :
Function Description:
Lists user-related information that failed to log on to the system, executes the LASTB instruction separately, and reads the text that is located under the/var/log directory with the name Btmp
Log in to the system, and the list of users who have logged in the file You can specify the account name or terminal number to list only the specified range.
Parameters
-a The host name or IP address from which to log in to the system, displayed in the last line;
-D converts the IP address to the host name. When a user logs in to the system from a remote location other than a local host, it is not only the host name, but also the IP address of the remote host. By default, the remote host is displayed with an IP address, which can be replaced with the host name;
-f Specifies the record file. The default last instruction will read the Btmp file in the/var/log directory;
- N Sets the number of displayed columns of the list, if you only want to query the last logged in the system's 10-bit user name, you can set the number of display columns to "10", to query the last 30 users, then set to "30", and so on;
-R does not display the host name or IP address of the login system;
- x displays information such as system shutdown, reboot, and execution level changes.
Linux cleanup last record:
# True >/var/log/wtmp
Linux purge Lastb records:
# True >/var/log/btmp
This article is from the "How Big Heart" blog, please be sure to keep this source http://qq512430.blog.51cto.com/5955081/1894424
Linux account login Security related commands