[精讚] [會員登入]
5600

[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

你可能感興趣的文章

[CENTOS7] 安裝rrdtool+RRDs+PERL 要讓perl繪圖,安裝rrdtool和RRDs

[Centos8] 校時ntpdate? 以前常用的ntpdate,在centos8竟然不見了?

[Centos6 7] 掛載磁碟 只是掛載新磁碟

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

[CENTOS8] Failed to download metadata for repo 'appstream' 的問題 Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist的解決方法。

[Centos7] 安裝 semanage (selinux工具程式) 安裝selinux的工具程式 semanage

隨機好文

談借錢 人借錢時手心向上頭向下,人還錢時手心向下頭向上

NETCRAFT發現你的網站及作業系統 NETCRAFT可以發現你的網站及作業系統

APACHE的記錄檔格式 LogFormat 語法 在APACHE中有定義一些記錄的語法模版 在 /etc/httpd/conf/httpd.conf 中: LogForm

[CodeIgniter 3] 資料庫的使用方法整理1/2 --Select的使用 [CodeIgniter 3] 資料庫的使用方法整理:Select的使用

只會買到爛貨的政府採購法 政府採購的公開招標,常常就只能比價格不能比品牌,只能比價格不能比品質,只能比價格不能比口碑,只能比價格不能比信用...