Linux清除使用者登陸及歷史命令
阿新 • • 發佈:2021-12-17
備忘:
當你的才華還撐不起你的野心的時候,你就應該靜下心來學習;當你的能力還駕馭不了你的目標時,就應該沉下心來,歷練;夢想,不是浮躁,而是沉澱和積累,只有拼出來的美麗,沒有等出來的輝煌,機會永遠是留給最渴望的那個人,學會與內心深處的你對話,問問自己,想 要怎樣的人生,靜心學習,耐心沉澱,送給自己,共勉。
**************************************************************************************
清除登陸系統成功的記錄 [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 //或清空使用者目錄下的這個檔案即可 匯入空歷史記錄 [root@localhost root]# vi /root/history //新建記錄檔案 [root@localhost root]# history -c //清除記錄 [root@localhost root]# history -r /root/history.txt //匯入記錄 [root@localhost root]# history //查詢匯入結果 example [root@localhost root]# vi /root/history [root@localhost root]# history -c [root@localhost root]# history -r /root/history.txt [root@localhost root]# history [root@localhost root]# echo > /var/log/wtmp [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 [root@localhost root]# history echo > /var/log/wtmp last echo > /var/log/btmp history -c echo > ./.bash_history vi /root/history history -c history -r /root/history.txt history -cw
**************************************************************************************
當你的才華還撐不起你的野心的時候,你就應該靜下心來學習;當你的能力還駕馭不了你的目標時,就應該沉下心來,歷練;夢想,不是浮躁,而是沉澱和積累,只有拼出來的美麗,沒有等出來的輝煌,機會永遠是留給最渴望的那個人,學會與內心深處的你對話,問問自己,想 要怎樣的人生,靜心學習,耐心沉澱,送給自己,共勉。
**************************************************************************************