[精讚] [會員登入]
5899

[Linux] 刪除last/lastb登出入記錄

linux shell的登出入記錄

分享此文連結 //n.sfs.tw/10382

分享連結 [Linux] 刪除last/lastb登出入記錄@新精讚
(文章歡迎轉載,務必尊重版權註明連結來源)
2019-10-23 11:36:32 最後編修
2016-12-06 10:27:59 By 張○○
 

自動目錄

查看

查看登出入記錄
$ last

axer     pts/0        211-75-194-241.h Sat Apr 18 14:19 - 15:22  (01:03)   

更詳細的登出入記錄包含失敗
# lastb

root     ssh:notty    218.86.88.31     Fri Dec  2 17:35 - 17:35  (00:00)   

登出入的時間
$ last -F

axer     pts/0        125-227-204-23.h Thu Apr 16 13:55:22 2015 - Thu Apr 16 15:45:40 2015  (01:50) 

限定使用者'username'
$ last username

限定筆數
$ last -n 5

查看帳戶的登入情況

...
axer             pts/3    120.109.248.230  二 12月  6 10:00:17 +0800 2016
mailnull                                   **從未登入過**
...

刪除

last資料儲存在/var/log/wtmp;lastb資料儲存在/var/log/btmp;lastlog資料儲存在/var/log/lastlog

只要把這兩個檔清空即可

刪除 last 記錄
# > /var/log/wtmp

刪除 lastb 記錄
# > /var/log/wtmp

刪除 lastlog 記錄
# > /var/log/lastlog

參考資料

[1] https://www.cyberciti.biz/faq/howto-display-clear-last-login-information/

 

END

你可能感興趣的文章

安裝網頁套件管理程式 Bower 一個非常棒的Javascript套件管理程式bower,用完愛不釋手。

使用dnstop 來觀察dns運作的情形 dnstop是非常方便的工具,可以觀察即時的dns查詢。 安裝 yum install dnstop

[Linux] 刪除last/lastb登出入記錄 linux shell的登出入記錄

[Centos8] PHP7.2升級到7.4 在centos8中把php 7.2升到7.4版

[bc] linux 的計算機 bc 設定小數位數、計算π、次方根 linux 的計算機 bc 設定小數位數、計算π、次方根

[SELINUX] php 呼叫系統程式(使用exec, system等)執行網路服務 這近想透過PHP呼叫系統的程式來執行網路的服務,怎麼測試都失敗…

隨機好文

[jQuery] select 元件的取值及給值 html中的元件select,在jquery中要如何使用?

SELinux 常用指令和檔案 在Redhat系列中,Centos5以後加入了selinux,他並沒有這麼可怕,不必每次看到Selinux ,就想把他

PHP for sphinx 函式庫安裝 PECL/sphinx PHP>= 5.2.2 已經能原生支援 sphinx,可是預設的沒有裝,我們得自己裝才能用

TFTP Server 安裝及使用 讓設備的網路設定檔或是韌體經由TFTP拷備出來,操作的方法

外匯課程經驗 有天遇到某個朋友的正妹朋友,說她有個很棒的外匯投資課程,要我們去聽,只收場地費200大洋。她又說續效最差一個月也有1%,誰還在苦哈哈上班?