lastb:显示用户登录失败的记录

xiaohai 2021-05-05 20:48:12 1790人围观 标签: Linux 
简介lastb命令用于显示用户登录失败日志记录。从日志文件/var/log/btmp读取信息。
说明

  lastb命令用于显示用户登录失败日志记录。从日志文件/var/log/btmp读取信息。

格式

  lastb [option]

常用参数
  • -n:显示指定结果的行数,其实也可以省略该参数
示例
[root@localhost ~]# lastb 
skip     ssh:notty    192.168.71.107   Sat May 12 16:57 - 16:57  (00:00)    
skip     ssh:notty    192.168.71.107   Sat May 12 16:56 - 16:56  (00:00)    
skip     ssh:notty    192.168.71.107   Sat May 12 16:55 - 16:55  (00:00)    
(unknown tty1                          Sat May  5 13:30 - 13:30  (00:00)    
root     tty1                          Sat May  5 13:30 - 13:30  (00:00)    

btmp begins Sat May  5 13:30:09 2018
[root@localhost ~]# lastb -3
skip     ssh:notty    192.168.71.107   Sat May 12 16:57 - 16:57  (00:00)    
skip     ssh:notty    192.168.71.107   Sat May 12 16:56 - 16:56  (00:00)    
skip     ssh:notty    192.168.71.107   Sat May 12 16:55 - 16:55  (00:00)    

btmp begins Sat May  5 13:30:09 2018
[root@localhost ~]# lastb -n 2
skip     ssh:notty    192.168.71.107   Sat May 12 16:57 - 16:57  (00:00)    
skip     ssh:notty    192.168.71.107   Sat May 12 16:56 - 16:56  (00:00)    

btmp begins Sat May  5 13:30:09 2018