久久国产精品成人影院|h肉动漫在线观看免费资源|亚洲熟妇色xxxxx欧美老|a片8888|国产成人无码影片在线观看

Linux lastb命令

發(fā)布時間:2018-05-11 12:17

Linux lastb命令

Linux 命令大全 Linux 命令大全

Linux lastb 命令用于列出登入系統(tǒng)失敗的用戶相關(guān)信息。

單獨執(zhí)行 lastb 指令,它會讀取位于 /var/log 目錄下,名稱為 btmp 的文件,并把該文件記錄登入失敗的用戶名,全部顯示出來。

語法

lastb [-adRx][-f <記錄文件>][-n <顯示行數(shù)>][帳號名稱...][終端機編號...]

參數(shù)說明

options:

  • -R 省略主機名 hostname 的列
  • -a  把從何處登入系統(tǒng)的主機名稱或IP地址顯示在最后一行。
  • -d  將IP地址轉(zhuǎn)換成主機名稱。
  • -f<記錄文件>  指定記錄文件。
  • -n<顯示行數(shù)>或-<顯示行數(shù)>  顯示名單的行數(shù)。
  • -R  不顯示登入系統(tǒng)的主機名稱或IP地址。
  • -x  顯示系統(tǒng)關(guān)機,重新開機,以及執(zhí)行等級的改變等信息。

username:

  • username: 顯示指定用戶 username 的登錄信息。

tty:

  • tty 設(shè)置登錄的終端,tty 的名稱可以縮寫, last 0last tty0 相同。

實例

顯示屬于登錄失敗的用戶信息:

# lastb 
...
zgg      ssh:notty    143.198.176.57   Thu Apr  7 11:27 - 11:27  (00:00)
zgg      ssh:notty    143.198.176.57   Thu Apr  7 11:27 - 11:27  (00:00)
zf       ssh:notty    143.198.176.57   Thu Apr  7 11:27 - 11:27  (00:00)
za       ssh:notty    143.198.176.57   Thu Apr  7 11:27 - 11:27  (00:00)
zeng     ssh:notty    143.198.176.57   Thu Apr  7 11:27 - 11:27  (00:00)
zf       ssh:notty    143.198.176.57   Thu Apr  7 11:27 - 11:27  (00:00)
zette    ssh:notty    143.198.176.57   Thu Apr  7 11:27 - 11:27  (00:00)
z310     ssh:notty    143.198.176.57   Thu Apr  7 11:27 - 11:27  (00:00)

btmp begins Fri Apr  1 07:38:45 2022

顯示 5 行登錄失敗的用戶信息:

# lastb -n 5
mos      ssh:notty    194.31.98.204    Thu Apr 28 16:52 - 16:52  (00:00)
user     ssh:notty    194.31.98.204    Thu Apr 28 16:52 - 16:52  (00:00)
user     ssh:notty    194.31.98.204    Thu Apr 28 16:52 - 16:52  (00:00)
user     ssh:notty    194.31.98.204    Thu Apr 28 16:52 - 16:52  (00:00)
user     ssh:notty    194.31.98.204    Thu Apr 28 16:52 - 16:52  (00:00)

btmp begins Fri Apr  1 07:38:45 2022

Linux 命令大全 Linux 命令大全

本文導(dǎo)讀

客戶熱線: