Last update at :2024-06-23,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.
BashCommand 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 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.
Bashecho > /var/log/wtmp #Clear successful login information
The 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:
Bashlastb |less lastb |grep [filter parameters] #Clear login failed logs echo > /var/log/btmp
Bricklayer 2022 New Year’s Day Promotion
- New Year’s discount code for Bricklayer: BWHNY2022
- Bricklayer 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.Plan | Memory | CPU | Hard disk | Traffic/month | Bandwidth | Computer room | Regular price | New Year's Price | Buy |
---|---|---|---|---|---|---|---|---|---|
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 a year $99.99/year |
$46.51/half a 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 searches: Dalian virtual host, Hong Kong high-defense server, Taiwan server rental, IP proxy, international domain name, registered domain name purchase, US host ranking, US vps host, Hengtian host, website registered domain name query,
发表评论