前言
阿里云盾(AliYunDun),又名安骑士,是购买阿里云云产品后自带的监控云服务器/轻量应用服务器安全的产品,能够自动化实时入侵威胁检测、病毒查杀、漏洞智能修复、基线一键核查等功能,但是同时也会监控你的服务器是否有违规进程,然后就会收到“阿里云警告邮件”。
阿里云盾主要包括3个进程:AliYunDun、aliyun-service和AliYunDunUpdate。
教程
1.可以先用以下命令查询一下是否有阿里云盾的进程
1
| ps -aux | grep -E 'aliyun|AliYunDun'
|
2.确认存在进程,执行以下指令卸载云盾(官方脚本)
1 2 3 4 5 6
| wget http://update.aegis.aliyun.com/download/uninstall.sh chmod +x uninstall.sh ./uninstall.sh wget http://update.aegis.aliyun.com/download/quartz_uninstall.sh chmod +x quartz_uninstall.sh ./quartz_uninstall.sh
|
3.卸载阿里云盾后,执行如下代码删除阿里云盾文件残留
若有一些文件无法删除,可以先重启主机再执行
1 2 3
| pkill aliyun-service rm -rf /etc/init.d/agentwatch /usr/sbin/aliyun-service rm -rf /usr/local/aegis*
|
4.最后就是屏蔽阿里云盾的IP
1 2 3 4 5 6 7 8 9 10 11
| iptables -I INPUT -s 140.205.201.0/28 -j DROP iptables -I INPUT -s 140.205.201.16/29 -j DROP iptables -I INPUT -s 140.205.201.32/28 -j DROP iptables -I INPUT -s 140.205.225.192/29 -j DROP iptables -I INPUT -s 140.205.225.200/30 -j DROP iptables -I INPUT -s 140.205.225.184/29 -j DROP iptables -I INPUT -s 140.205.225.183/32 -j DROP iptables -I INPUT -s 140.205.225.206/32 -j DROP iptables -I INPUT -s 140.205.225.205/32 -j DROP iptables -I INPUT -s 140.205.225.195/32 -j DROP iptables -I INPUT -s 140.205.225.204/32 -j DROP
|
5.检查阿里云盾是否卸载干净
最后检查下自己服务器上的阿里云盾是否卸载干净了,主要就是看进程里有没有阿里云盾的相关进程了(AliYunDun、aliyun-service和AliYunDunUpdate),可以通过ps -aux | grep -E 'aliyun|AliYunDun'
来检查,如果没有相关进程则说明阿里云盾已经卸载干净了。
参考文章:
阿里云如何完全卸载阿里云盾(安骑士)并屏蔽阿里云盾IP - VPS GO