清理登入日誌

2021-09-11 21:38:33 字數 426 閱讀 4804

[root@localhost root]# echo > /var/log/wtmp //此檔案預設開啟時亂碼,可查到ip等資訊

[root@localhost root]# last //此時即查不到使用者登入資訊

清除登陸系統失敗的記錄

[root@localhost root]# echo > /var/log/btmp //此檔案預設開啟時亂碼,可查到登陸失敗資訊

[root@localhost root]# lastb //查不到登陸失敗資訊

清除歷史執行命令

[root@localhost root]# history -c //清空歷史執行命令

[root@localhost root]# echo > ./.bash_history //或清空使用者目錄下的這個檔案即可

日誌清理 sh

bin bash log dir var log root uid 0 lines 50 e xcd 66 e notroot 67 e wrongargs 65 if uid ne root uid then echo must be root to run this script.exit e ...

logrotate清理日誌

清理日誌 logrotate配置目錄 etc logrotate.d 配置引數資訊 引用文字 monthly monthly 日誌檔案將按月輪循。其它可用值為 daily weekly yearly size 50m 日誌檔案大小可以增長到50m rotate 5 一次將儲存5個歸檔日誌。對於第六個...

docker清理日誌

docker 用久了 日誌一大堆,很占用空間,不用的日誌可以清理掉了。docker logs f container name 噼里啪啦 一大堆,太對,清理掉 找到對應container的日誌檔案,一般是在 var lib docker containers containerid containe...