Linux account login Security related commands

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.