Last time, I mentioned that my Hong Kong lightweight server had been released from the black room, and I then used it to set up Shadowsocks. Unfortunately, Alibaba Cloud’s system has some very unpleasant built-in monitoring, which is probably able to detect the Shadowsocks process and put it back into the black room, so it is necessary to purify the system.
Vicer has written a purification script, but unfortunately it does not support CentOS 7. Fortunately, there is an expert on Loc who specifically created a purification script for Alibaba Cloud CentOS 7, which can remove monitoring and other unnecessary functions.
This script can remove Alibaba Cloud’s monitoring programs and use the firewall to block malicious IPs in order to protect your privacy. It switches to other yum repositories. The Alibaba Cloud mirror lacks the latest software packages, and using these outdated packages may lead to security vulnerabilities. It also ensures genuine one-click purification while retaining existing functionality, supports all CentOS 7 machines, and can optimize and purify all CentOS 7 systems based on built-in templates.
Script Functions
将 DNS 永久改为 1.1.1.1/8.8.8.8,一个宣称不收集用户隐私,一个备用信仰加成,防止服务商对服务器访问内容的监控。
Yum Mirror 修改为 CentOS 官方源,自动适配离机房距离较近的源,全球服务器均可通用。
增加对云盾新 IP 段的屏蔽。
增加对云盾新组件的清除工作。
拓展源 epel 的更新。
MOTD 登录提示的规范化。
净化完可根据提示一键更换内核安装 LotServer。
Script Address
Github address: https://github.com/MeowLove/AlibabaCloud-CentOS7-Pure-and-safe
Run the following commands as root:
# 全新的安装
sudo curl -sSL https://raw.githubusercontent.com/MeowLove/AlibabaCloud-CentOS7-Pure-and-safe/master/download/kill/New_installation.sh | sudo bash
# 快照/镜像恢复
sudo curl -sSL https://raw.githubusercontent.com/MeowLove/AlibabaCloud-CentOS7-Pure-and-safe/master/download/kill/Snapshot_image.sh | sudo bash
# 更换内核并安装 LotServer
sudo curl -sSL https://raw.githubusercontent.com/MeowLove/AlibabaCloud-CentOS7-Pure-and-safe/master/download/LotServer/install.sh | sudo bash
Script Description
Fresh installation
Suitable for a system that has just been installed through your server control panel. Run this.
Snapshot recovery
Suitable for systems that have used the fresh-installation purification script. Run it when restoring after a backup (that is, after restoring the system using the service provider’s snapshot or an image service you created yourself, the provider’s repositories and DNS, as well as security-hardening software such as Alibaba Cloud’s Cloud Shield, will be inserted again).
If the external IP cannot be accessed after a fresh installation, you need to disable the firewall:
systemctl stop firewalld.service
systemctl disable firewalld.service