Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the lastb command in Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "how to use the lastb command in Linux". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn how to use the lastb command in Linux.

Linux common command lastb command is used to display the login list of user errors. This instruction can find the login exception of the system.

Lastb lists information about users who failed to log in to the system.

Additional instructions execute the lastb command alone, which will read the file named btmp located in the / var/log directory and display the list of users who failed to log in.

Syntax lastb (option) (parameter) option-a: display the host name or ip address from where to log in to the system on the last line;-d: convert the IP address to the host name;-f: specify the record file;-n or -: set the number of display columns for the list;-R: do not display the host name or IP address for the login system -x: displays information such as system shutdown, reboot, and change of execution level. Parameter user name: login list of users in the display

Terminal: displays a list of logins from the specified terminal.

The error will be reported when the instance runs the lastb command for the first time:

Lastb: / var/log/btmp: No such file or directory Perhaps this file was removed by the operator to prevent logging lastb info. Just create this non-existent file.

Login failures of touch / var/log/btmp using ssh are not logged in the btmp file.

Lastb | head root ssh:notty 110.84.129.3 Tue Dec 17 06:19-06:19 (00:00) root ssh:notty 110.84.129.3 Tue Dec 17 04:05-04:05 (00:00) root ssh:notty 110.84.129.3 Tue Dec 17 01:52-01 lastb 52 (00VOO) root ssh:notty 110.84.129.3 Mon Dec 16 23: 38-23:38 (00:00) leonob ssh:notty 222.211.85.18 Mon Dec 16 22:18-22:18 (00:00) leonob ssh:notty 222.211.85.18 Mon Dec 16 22:18-22:18 (00leonob ssh:notty) root ssh:notty 110.84.129.3 Mon Dec 16 21 root ssh:notty 25-21 root ssh:notty 25-21 root ssh:notty 110.84.129.3 Dec 16 19:12-19:12 (00:00) root ssh:notty 110.84.129.3 Mon Dec 16 17:00-17:00 (00:00) admin ssh:notty 129.171.193.99 Mon Dec 16 16:52-16Dec 52 (00Dec) above are all the contents of the article "how to use lastb commands in Linux" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report