Clear the CentOS system user login record and command record

Source: Internet
Author: User
Tags syslog

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 2
1 Echo>/var/log/secure #如果没有这个文件, restart the syslog process service syslog restart

Clear History Command

1 2 Cd/root/echo>. bash_history

Or

1 History-c #清除命令记录

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.