1 2 |
echo>/var/log/wtmp# Clear User login record and command record [root @localhost root]# last//The user logon information is not found at this time |
1 |
Echo>/var/log/secure #如果没有这个文件, restart the syslog process service syslog restart |
Clear History Command
1 2 |
Cd/root/echo>. bash_history |
Or
You can also write a shell script, a key to clear all the logs
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 |
Clear the CentOS system user login record and command record