1
2
|
echo>/var/log/wtmp#清除用戶登陸記錄和命令記錄
[root
@localhost root]# last //此時即查不到用戶登陸信息
|
1
2
|
echo>/var/log/btmp
[root
@localhost root]# lastb //查不到登錄失敗信息
|
1
|
echo>/var/log/secure #若是沒有這個文件,重啓syslog進程service syslog restart
|
清除歷史命令 web
1
2
|
cd/root/
echo> .bash_history
|
或者 shell
1
|
history-c #清除命令記錄
|
也能夠寫個shell腳本,一鍵清除全部的日誌 bash
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/bin/sh
cat/dev/null>/var/log/syslog
cat/dev/null>/var/adm/sylog
cat/dev/null>/var/log/wtmp
cat/dev/null>/var/log/maillog
cat/dev/null>/var/log/messages
cat/dev/null>/var/log/openwebmail.log
cat/dev/null>/var/log/maillog
cat/dev/null>/var/log/secure
cat/dev/null>/var/log/httpd/error_log
cat/dev/null>/var/log/httpd/ssl_error_log
cat/dev/null>/var/log/httpd/ssl_request_log
cat/dev/null>/var/log/httpd/ssl_access_log
|