黄色片网站免费观看-黄色片网站观看-黄色片网站大全-黄色片视频网-色偷偷网址-色偷偷网站

lastb

列出登入系統失敗的用戶相關信息

補充說明

lastb命令 用于顯示用戶錯誤的登錄列表,此指令可以發現系統的登錄異常。單獨執行lastb命令,它會讀取位于/var/log目錄下,名稱為btmp的文件,并把該文件內容記錄的登入失敗的用戶名單,全部顯示出來。

語法

lastb(選項)(參數)

選項

-a:把從何處登入系統的主機名稱或ip地址顯示在最后一行;
-d:將IP地址轉換成主機名稱;
-f<記錄文件>:指定記錄文件;
-n<顯示列數>或-<顯示列數>:設置列出名單的顯示列數;
-R:不顯示登入系統的主機名稱或IP地址;
-x:顯示系統關機,重新開機,以及執行等級的改變等信息。

參數

實例

首次運行lastb命令會報下的錯誤:

lastb: /var/log/btmp: No such file or directory
Perhaps this file was removed by the operator to prevent logging lastb info.

只需建立這個不存在的文件即可。

touch /var/log/btmp

使用ssh的登錄失敗不會記錄在btmp文件中。

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:52  (00:00)
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  (00:00)
root     ssh:notty    110.84.129.3     Mon Dec 16 21:25 - 21:25  (00:00)
root     ssh:notty    110.84.129.3     Mon 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 - 16:52  (00:00)