如果我们在使用阿里云ECS服务器的时候,是否会发现有些网站或者出现关键字会被扫描到提示不安全内容,而且可能会被自动屏蔽这篇文章的URL,甚至要求我们删除这篇文章。以及我们有些程序可能并不存在安全问题,但是阿里云会自动报错提示有安全问题需要我们修复。
出现这样的问题在于阿里云ECS服务器会自动安装有安骑士以及云盾扫描我们网站和项目中的内容。如果我们希望不被扫描到,那就需要我们来手工卸载这个软件,在云服务器后台是不提供关闭服务的。那我们就去自己手工卸载。
第一、卸载安骑士
1、卸载软件
wget http://update.aegis.aliyun.com/download/quartz_uninstall.sh
chmod +x quartz_uninstall.sh
./quartz_uninstall.sh
2、删除残留
rm -rf /etc/init.d/agentwatch /usr/sbin/aliyun-service
rm -rf /usr/local/aegis*
第二、屏蔽云盾
同时,云盾也是需要屏蔽掉的,这里我们直接将云盾的IP段屏蔽到iptables中。
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
写入之后然后保存iptables。
service iptables save
这样我们就屏蔽了阿里云安骑士,以及云盾。如果我们需要开启,那可以再安装。
wget http://update.aegis.aliyun.com/download/install.sh
chmod +x install.sh
sh install.sh
安骑士安装,云盾只要将iptables中释放屏蔽的IP段即可。