Last update at :2024-01-27,Edit by888u
VPS users who often use the Linux system will definitely check the user login log, especially some developers. There are two types of logs to record user login behavior, namely recording the user's data and recording the user's login behavior. Login time, this article introduces several commonly used user login log query methods in Linux.
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.
Bash Command parameters: -b2. Last lists the information of users who have logged in to the system
last can view the user information logged into the system. By default, the /var/log/wtmp file information is read. You can also read the specified file through the -f parameter.
Bash echo > /var/log/wtmp #Clear successful login informationThe last command is best used in conjunction with the filter command and is also highly recommended.
3. lastb lists failed login records
The lastb command is similar to the last command above. It lists the login information of users who failed to log in. By default, it reads the /var/log/btmp file information. The command example is as follows:
Bash lastb |less lastb |grep [filter parameters] #Clear login failed logs echo > /var/log/btmpBanwagonhost 2022 New Year’s Day Promotion
- New Year’s discount code for Banwagonhost: BWHNY2022
- Banwagonhost discount code: BWH3HYATVBJW, discount 6.58%, available everywhere.
Recommended discounts/cost-effective packages for bricklayers
Warm reminder: If you have difficulty choosing, just choose the CN2 GIA-E plan in the middle. The quarterly payment is $49.99, and you can switch between up to 12 computer rooms at will.CN2 (cheapest) | 1GB | 1 core | 20GB | 1TB | 1Gbps | DC3 CN2 DC8 ZNET | $49.99/year | $43.88/year | Buy |
CN2 | 2GB | 1 core | 40GB | 2TB | 1Gbps | $52.99/half year $99.99/year | $46.51/half year $87.77/year | Buy | |
CN2 GIA-E (Most recommended) | 1GB | 2 cores | 20GB | 1TB | 2.5Gbps | DC6 CN2 GIA-E DC9 CN2 GIA Japan SoftBank JPOS_1 China Unicom Netherlands EUNL_9 | $49.99/quarter $169.99/year | $43.88/quarter $149.22/year | Buy |
CN2 GIA-E | 2GB | 3 core | 40GB | 2TB | 2.5Gbps | $89.99/quarter $299.99/year | $78.99/quarter $263.33/year | Buy | |
HK | 2GB | 2 cores | 40GB | 0.5TB | 1Gbps | Hong Kong, China CN2 GIA | $89.99/month $899.99/year | $78.99/month $790.01/year | Buy |
HK | 4GB | 4 core | 80GB | 1TB | 1Gbps | $155.99/month $1559.99/year | $136.93/month $1369.36/year | Buy | |
TOKYO | 2GB | 2 cores | 40GB | 0.5TB | 1.2Gbps | Tokyo, Japan CN2 GIA | $89.99/month $899.99/year | $78.99/month $790.01/year | Buy |
TOKYO | 4GB | 4 core | 80GB | 1TB | 1.2Gbps | $155.99/month $1559.99/year | $136.93/month $1369.36/year | Buy |
Select a suggestion:
- Getting started: Los Angeles CN2 package, currently the cheapest, optional CN2 GT computer room, the entry-level choice.
- Recommendation: Los Angeles CN2 GIA-E package, super fast, with many optional computer rooms (DC6, DC9, Japan SoftBank, Netherlands Unicom, etc.), the most cost-effective.
- High-end: Hong Kong CN2 GIA package, the price is higher, but impeccable. The Tokyo CN2 GIA package is also a very good high-end option.
Recommended site search: server rental US high-defense, domain name registration official website, agent registration, renting server, mainland China registration-free space, domain name registration official website, domain name space registration https proxy ip, Taiwan server, Hong Kong space,
发表评论