linux 清理删除远程登录日志
作者:高景洋 日期:2023-07-17 21:23:13 浏览次数:981
我们在实际的linux远程连接过程中,会产生很多垃圾日志,如何清理这些登录日志呢?
1、将以下脚本存成 cl.sh 文件,上传到服务器上
#!/usr/bin/bash
echo > /var/log/syslog
echo > /var/log/messages
echo > /var/log/xferlog
echo > /var/log/secure
echo > /var/log/auth.log
echo > /var/log/user.log
echo > /var/log/wtmp
echo > /var/log/lastlog
echo > /var/log/btmp
echo > /var/run/utmp
history -c
2、在服务器上,执行 source cl.sh ,即可清理日志
本文永久性链接:
<a href="http://r4.com.cn/art236.aspx">linux 清理删除远程登录日志</a>
<a href="http://r4.com.cn/art236.aspx">linux 清理删除远程登录日志</a>
当前header:Host: r4.com.cn
X-Host1: r4.com.cn
X-Host2: r4.com.cn
X-Host3: 127.0.0.1:8080
X-Forwarded-For: 3.145.33.175
X-Real-Ip: 3.145.33.175
X-Domain: r4.com.cn
X-Request: GET /art236.aspx HTTP/1.1
X-Request-Uri: /art236.aspx
Connection: close
Accept: */*
User-Agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Accept-Encoding: gzip, br, zstd, deflate