Hot Article
- Centos7 closes and restarts the system firewall and opens firewall ports
- How IID server uses Xshell to connect to Linux (centos) server
- BT panel forgets the background login URL, and the solution to the security entrance verification failure
- The php domain name points to ip, how to use the specified ip address to access a server in the url request domain name in curl mode
- How to purchase a dedicated server
- Error connecting to MySQL: Cant connect to MySQL server (10060)
How to view user login logs in the IID server Linux system?
- Author:Kevin
- Category:Server Maintain
- Release Time:2022-11-29
Developers who often use Linux systems will definitely query user login logs. There are two types of logs to record user login behaviors when viewing user login logs. Linux common user login log query method.
1. lastlog lists the last login information of all users
lastlog refers to the content in /var/log/lastlog, and will display the login name, port number (tty) and last login time. Note that you need to run this command as root.
Command parameters:
-b: display login information before the specified number of days
-t: display login information since the specified number of days
-u: Display the latest login information of the specified user
2. last lists the user information who have logged in to the system
last can view the user information logged in to the system. By default, the file information of /var/log/wtmp is read, and the specified file can also be read through the -f parameter.
echo > /var/log/wtmp
# Clear the successful login information
The last command works best with the filter command and is highly recommended.
3. lastb lists failed login records
The lastb command is similar to the above last command. It lists the login information of the user who failed to log in. By default, the /var/log/btmp file information is read. The command example is as follows:
lastb |less
lastb |grep [filter parameters]
# Clear the log of failed logins
echo > /var/log/btmp
related topic
- Windows firewall settings only allow specified IPs to access specified ports
- How to view user login logs in the IID server Linux system?
- What should I do if the proxy server link fails to respond?
- IDGlobal teaches you to disable ICMP protocol on CentOS
- How to fix 403forbidden (detailed solution)
- What should I do if the cloud storage space is full (solutions for clearing the cloud storage space)