Aliyun,有时就算选择了不加载安骑士,也会偷偷加载,相当烦人,因此本文记载阿里云镜像的清理。 (想监控我,没门!)


#!/bin/bash

sudo systemctl stop aegis
sudo systemctl disable aegis
sudo rm -rf /etc/init.d/aegis
sudo systemctl stop aliyun
sudo systemctl disable aliyun
sudo systemctl stop cloud-config
sudo systemctl disable cloud-config
sudo systemctl stop cloud-final
sudo systemctl disable cloud-final
sudo systemctl stop cloud-init-local.service
sudo systemctl disable cloud-init-local.service
sudo systemctl stop cloud-init
sudo systemctl disable cloud-init
sudo systemctl stop exim4
sudo systemctl disable exim4
sudo systemctl stop apparmor
sudo systemctl disable apparmor
sudo rm -rf /etc/systemd/system/aliyun.service
sudo rm -rf /lib/systemd/system/cloud-config.service
sudo rm -rf /lib/systemd/system/cloud-config.target
sudo rm -rf /lib/systemd/system/cloud-final.service
sudo rm -rf /lib/systemd/system/cloud-init-local.service
sudo rm -rf /lib/systemd/system/cloud-init.service
sudo rm -rf /lib/systemd/system/ctrl-alt-del.target
sudo systemctl daemon-reload

注:如果你觉得还不够,可以dd系统,甚至加密系统盘。

一键DD脚本为VPS服务器更换/重装纯净版CentOS/Debian/Ubuntu
創建加密raw系統鏡像
通過此方法生成的鏡像應用到伺服器後,可以在開機的時候使用ssh登陸後輸入密碼。創建虛擬塊設備根據您的伺服器硬盤大小創建硬盤大小(一般來說10G即可)sudo dd if=/dev/zero of=archlinux.raw bs=1M count=10240 status=progress #創建10G大小的鏡像