阿里云ECS轻量、腾讯云服务器监控一键卸载

阿里云、腾讯云的服务器都自带监控(AliYunDun/阿里云盾/安骑士),大家都不想自己的所作所为都被监控着,我们总想着自己买的东西能够完全自己做主,所以我们需要让他的监控失效,卸载监控

卸载阿里云ecs服务器AliYunDun

1.首先需要到阿里云盾关闭客户端

点击左侧【主机资产】,找到对应需要关闭的服务器右侧的【查看】

图片[1] | 阿里云ECS轻量、腾讯云服务器监控一键卸载 | 讯沃blog

2.把下图中四项全部关闭掉。

【客户端自保护】

【网站后门连接防御】

【恶意网络行为防御】

【恶意主机行为防御】

方案1:卸载

第一步:SSH连接阿里云服务器,在终端中输入下方命令,进行卸载AliYunDun操作

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

第二步:继续在终端中输入下发命令,删除AliYunDun残留

pkill aliyun-service
rm -fr /etc/init.d/agentwatch /usr/sbin/aliyun-service
rm -rf /usr/local/aegis*

第三步:屏蔽云盾IP。执行下面命令通过“iptables”防火墙来屏蔽云盾IP

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

执行下面的命令来查找进程还有没有。是否卸载干净

ps -ef | grep AliYunDun

或者:

ps -aux | grep -E 'aliyun|AliYunDun'
图片[3] | 阿里云ECS轻量、腾讯云服务器监控一键卸载 | 讯沃blog

无内容表示已经卸载干净,有内容表示没有卸载完。如下:
root 5207 4354 0 00:25 pts/0 00:00:00 grep –color=auto AliYunDun

方案2:关闭 AliYunDun

使用 chkconfig –list 查看开机启动里面这个软件的服务名是什么,然后 off 掉 aegis 执行就可以了。

# chkconfig --list
aegis           0:off   1:off   2:on    3:on    4:on    5:on    6:off
agentwatch      0:off   1:off   2:on    3:on    4:on    5:on    6:off
cloudmonitor    0:off   1:off   2:on    3:on    4:on    5:on    6:off
mysql           0:off   1:off   2:off   3:off   4:off   5:off   6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off

如果想开机不启动的话,chkconfig –del aegis 这个 aegis 就是你找出来的 aliyundun 的后台服务。

service aegis stop  # 停止服务
chkconfig --del aegis  # 删除服务

如果还有残留,可通过以下命令结束进程

ps -ef | grep -v grep | grep -i aliyundun | awk '{print $2}' | xargs kill -9

官方卸载文档

卸载腾讯云安全监控软件

1.输入命令方式

(2024-3-2实测可用)看下图的登录时间

云监控 Linux 安装目录是/usr/local/qcloud/stargate/usr/local/qcloud/monitor
还有一个主机安全,也就是所谓的云镜,新开服务器不取消勾选都会默认安装。
云镜 Linux 安装目录是/usr/local/qcloud/YunJing
安装了监控软件后如何卸载,操作如下:

/usr/local/qcloud/stargate/admin/uninstall.sh
/usr/local/qcloud/YunJing/uninst.sh
/usr/local/qcloud/monitor/barad/admin/uninstall.sh

此脚本卸载完腾讯云的监控,但是腾讯云文件夹并不是只有监控,为了保险起见,定制并删除云监控脚本插件

systemctl stop tat_agent
systemctl disable tat_agent
rm -f /etc/systemd/system/tat_agent.service
rm -fr /usr/local/qcloud

2.也可以使用打包好的shell

两个都可用,第二个国内可用

wget -qO- https://raw.githubusercontent.com/littleplus/TencentAgentRemove/master/remove.sh | bash
wget -qO- https://cdn.jsdelivr.net/gh/lufei/TencentAgentRemove@master/remove.sh | bash

查看是否卸载完成
20200317211308.jpg
卸载完成记得重启服务器

输入命令

ps -A | grep agent

无任何输出说明已经卸载完成,如果有输出,确认是不是你自己的程序

轻量打开root账户登录

轻量服务器需切换root账户登录

方案1,按照如下步骤输入命令:

使用 ubuntu 帐户登录轻量应用服务器。
执行以下命令,设置 root 密码。

sudo passwd root

输入 root 的密码,按 Enter。
重复输入 root 的密码,按 Enter。
返回如下信息,即表示 root 密码设置成功。

passwd: password updated successfully

执行以下命令,打开 sshd_config 配置文件。

sudo vi /etc/ssh/sshd_config 

i回车,切换至编辑模式,找到 #Authentication,将 PermitRootLogin 参数修改为 yes。

说明:
如果 PermitRootLogin 参数被注释,请去掉首行的注释符号(#)。

按 Esc,输入 :wq,保存文件并返回。
执行以下命令,重启 ssh 服务。

sudo service ssh restart

切换到root,输入密码进入。

su root

方案2,一键开启

sudo -i
echo root:77nn.net |chpasswd root
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
service sshd restart

默认的密码是77nn.net

登录后一定要修改密码!密码修改命令:passwd

图片[5] | 阿里云ECS轻量、腾讯云服务器监控一键卸载 | 讯沃blog

© 版权声明
THE END
喜欢就支持一下吧
点赞14赞赏 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容