[精讚] [會員登入]
5324

[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] 安裝phpMyAdmin Centos 7有新的方式可以安裝phpmyadmin,不必再採用過去的tarball安裝法。

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

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

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

[Centos7] 安裝apache+php7+mariadb10+selinux Centos7 安裝apache+php7+mariadb10+selinux

[Centos7] audit 服務 在紅帽和suse的linux中有一個audit這樣的daemon,寫入的是核心層的記錄。

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

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

[Windows7] 移除IE10及移除IE11 Windows7 不得已的情況要移除IE11或IE10怎麼做?

精讚的版面變化 ▓此文僅作為舊文的記錄▓ 這篇文章為了紀念改版完成而撰寫。 原本的部落格是民國97年的作品,那時還是用舊有的技術來寫,很

設計的工作絕不接受比價 拿買陽春麵的價格想買牛肉麵,寧願倒掉也不賣

正則表達式:Email名稱防止連續輸入點(.)及下底線(_) Email的名稱中要允許特殊符號,但又不允許連續出現的正則表達式