[精讚] [會員登入]
5597

[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

你可能感興趣的文章

[postfix] open /etc/postfix/main.cf: Permission denied 等錯誤 遇到開啟 /etc/postfix/main.cf: Permission denied 等錯誤解決

[APACHE] PHP<5.5及 PHP>=5.5 安裝APC php5.5版後的apc只能手動安裝,此文包含php<5.5及php>=5.5兩種安裝方法

[Rocky9] 安裝docker 安裝docker

[Centos7] HTTPS/SSL憑證的SELINUX設置 把申請來的憑證檔放到指定的位置後,沒辦法啟動,怎麼辦?

[Centos6] 安裝wordpress Centos 6下安裝wordpress,非常簡單

[CentOS] 新增修改及刪除使用者 新增、修改、刪除使用者和群組

隨機好文

使用Google尋找你的手機 這近發現google竟然可以用來找android的手機,而且不需要經過什麼設定或安裝軟體。

Linux shell 的date表示法 linux下SHELL中的date表示法

[PHP] 檢查IP是否在某個網段內 mtachcidr 要檢查IP是否在某個網段內,要寫幾行?10行?5行? 不用,只要2行。以下是我寫的 code /** * matchCI

[CodeIgniter 3] 資料庫的使用方法整理2/2 CI3 承襲 CI2,有很多的builder class可以用,依各人的使用習慣,有人喜歡一堆sql字串,有人喜歡用helper

「許功蓋」的字以及源由 有玩過電腦一段時間的人,都聽過這個人(有一天我才發現7年級的竟然都不認識這個