阿里云服务器卸载–AliYunDun阿里云盾

作者 : King 本文共7124个字,预计阅读时间需要18分钟 发布时间: 2024-10-4 共17人阅读

AliYunDun阿里云阿里云盾

阿里云服务器默认都给安装的有AliYunDun监控进程,占用资源其实也不高。不过在服务器里跑着总是有些碍眼的,下面给大家发下卸载步骤。

本文目录

相关链接

阿里云官方教程:https://help.aliyun.com/zh/security-center/user-guide/uninstall-the-security-center-agent

阿里云云安全中心控制台:https://yundun.console.aliyun.com/?spm=a2c4g.11186623.0.0.33d52fa03TJMV1&p=sas

卸载步骤

下面是2个卸载方式。

1.阿里云控制台卸载

打开阿里云云安全中心控制台,左侧下拉

系统配置–功能设置–客户端–卸载

在此处选择你的服务器然后知识兔点击卸载即可。

阿里云服务器卸载–AliYunDun阿里云盾

2.服务器内脚本卸载

Linux:

阿里云服务器

wget "http://update2.aegis.aliyun.com/download/uninstall.sh" && chmod +x uninstall.sh && ./uninstall.sh

非阿里云服务器

wget "http://update.aegis.aliyun.com/download/uninstall.sh" && chmod +x uninstall.sh && ./uninstall.sh

 

Windows:

下载卸载脚本,运行即可。管理员权限运行。

卸载脚本:https://update.aegis.aliyun.com/download/uninstall.bat?spm=a2c4g.11186623.0.0.33d52fa03TJMV1&file=uninstall.bat

脚本备份

Linux

#!/bin/bash# -i : uninstall before install, do not delete domaincfg.iniAEGIS_INSTALL_DIR="/usr/local/aegis"AEGIS_SYSTEMD_SERVICE_PATH="/etc/systemd/system/aegis.service"UNINSTALL_FOR_INSTALL=1 # 1 is false, 0 is true, default is falseUUID=""#check linux Gentoo os var=`lsb_release -a | grep Gentoo`if [ -z "${var}" ]; then var=`cat /etc/issue | grep Gentoo`ficheckCoreos=`cat /etc/os-release 2>/dev/null | grep coreos`if [ -d "/etc/runlevels/default" -a -n "${var}" ]; thenLINUX_RELEASE="GENTOO"elif [ -f "/etc/os-release" -a -n "${checkCoreos}" ]; thenLINUX_RELEASE="COREOS"AEGIS_INSTALL_DIR="/opt/aegis"else LINUX_RELEASE="OTHER"fiAEGIS_UPDATE_SITE_ARRAY[0]="update2.aegis.aliyun.com"AEGIS_UPDATE_SITE_ARRAY[1]="update4.aegis.aliyun.com"AEGIS_UPDATE_SITE_ARRAY[2]="update5.aegis.aliyun.com"AEGIS_UPDATE_SITE_ARRAY[3]="update.aegis.aliyun.com"stop_aegis_pkill(){pkill -9 AliHips >/dev/null 2>&1/usr/local/aegis/alihips/AliHips --stopdriverpkill -9 AliYunDun >/dev/null 2>&1pkill -9 AliYunDunMonitor >/dev/null 2>&1pkill -9 AliYunDunUpdate >/dev/null 2>&1pkill -9 AliNet >/dev/null 2>&1# TODO: do not kill AliSecGuard to avoid soft lock bug for old version# pkill -9 AliSecGuard >/dev/null 2>&1pkill -9 AliDetect >/dev/null 2>&1pkill -9 AliScriptEngine >/dev/null 2>&1/usr/local/aegis/AliNet/AliNet --stopdriver# /usr/local/aegis/AliSecGuard/AliSecGuard --stopdriverDRIVER_OWNER_FILE_PATH="/usr/local/aegis/AliSecGuard/driver_owner.txt"if [ -f "${DRIVER_OWNER_FILE_PATH}" ]; thenDRIVER_OWNER_PATH=$(cat "${DRIVER_OWNER_FILE_PATH}")"${DRIVER_OWNER_PATH}" --stopdriverfiprintf "%-40s %40s\n" "Stopping aegis" "[ OK ]"}# can not remove all aegis folder, because there is backup file in globalcfgremove_aegis(){kprobeArr=("/sys/kernel/debug/tracing/instances/aegis_do_sys_open/set_event""/sys/kernel/debug/tracing/instances/aegis_inet_csk_accept/set_event""/sys/kernel/debug/tracing/instances/aegis_tcp_connect/set_event""/sys/kernel/debug/tracing/instances/aegis/set_event""/sys/kernel/debug/tracing/instances/aegis_/set_event""/sys/kernel/debug/tracing/instances/aegis_accept/set_event""/sys/kernel/debug/tracing/kprobe_events""/usr/local/aegis/aegis_debug/tracing/set_event""/usr/local/aegis/aegis_debug/tracing/kprobe_events")for value in ${kprobeArr[@]}doif [ -f "$value" ]; thenecho > $valuefidoneif [ -d "${AEGIS_INSTALL_DIR}" ];thenumount ${AEGIS_INSTALL_DIR}/aegis_debugif [ -d "${AEGIS_INSTALL_DIR}/cgroup/cpu" ];thenumount ${AEGIS_INSTALL_DIR}/cgroup/cpufiif [ -d "${AEGIS_INSTALL_DIR}/cgroup" ];thenumount ${AEGIS_INSTALL_DIR}/cgroupfirm -rf ${AEGIS_INSTALL_DIR}/aegis_clientrm -rf ${AEGIS_INSTALL_DIR}/aegis_updaterm -rf ${AEGIS_INSTALL_DIR}/alihids# when uninstall.sh call by AliAqsInstall_64, it can not delete domaincfg.ini, because it may create new domaincfg.ini for install# UNINSTALL_FOR_INSTALL is 0 when call by AliAqsInstall_64if [ ${UNINSTALL_FOR_INSTALL} == 1 ]; thenecho "remove domaincfg.ini"rm -f ${AEGIS_INSTALL_DIR}/globalcfg/domaincfg.inififi}uninstall_systemd_service(){if [ -f "$AEGIS_SYSTEMD_SERVICE_PATH" ]; thensystemctl stop aegis 2>/dev/nullsystemctl disable aegis 2>/dev/nullrm -f "$AEGIS_SYSTEMD_SERVICE_PATH"fireturn 0}uninstall_service() {if [ -f "/etc/init.d/aegis" ]; then/etc/init.d/aegis stop >/dev/null 2>&1rm -f /etc/init.d/aegis fiif [ $LINUX_RELEASE = "GENTOO" ]; thenrc-update del aegis default 2>/dev/nullif [ -f "/etc/runlevels/default/aegis" ]; thenrm -f "/etc/runlevels/default/aegis" >/dev/null 2>&1;fielif [ -f /etc/init.d/aegis ]; then/etc/init.d/aegis uninstallfor ((var=2; var<=5; var++)) doif [ -d "/etc/rc${var}.d/" ];thenrm -f "/etc/rc${var}.d/S80aegis"elif [ -d "/etc/rc.d/rc${var}.d" ];thenrm -f "/etc/rc.d/rc${var}.d/S80aegis"fidonefi# uninstall systemd serviceuninstall_systemd_service}wait_aegis_exit(){var=1limit=10echo "wait aegis exit";while [[ $var -lt $limit ]]; do if [ -n "$(ps -ef|grep aegis_client|grep -v grep)" ]; thensleep 1elsereturnfi((var++))done echo "wait AliYunDun process exit fail, possibly due to self-protection, please uninstall aegis or disable self-protection from the aegis console."exit 6}report_uninstall_result(){echo "start report uninstall"checkValue=0for((; checkValue < ${#AEGIS_UPDATE_SITE_ARRAY[@]}; checkValue++)) doecho "${AEGIS_UPDATE_SITE_ARRAY[checkValue]}"curl --retry 2 --connect-timeout 5 -m 30 --header "Content-Type: application/json" --request POST --data "{\"version\": 4,\"data\": {\"uuid\": \"${UUID}\", \"type\": \"uninstall\"}}" "https://${AEGIS_UPDATE_SITE_ARRAY[checkValue]}/update"if [ $? == 0 ]; thenreturn $checkValuefidone;echo "report uninstall result error" 1>&2exit 1}# entryif [ `id -u` -ne "0" ]; thenecho "ERROR: This script must be run as root." 1>&2exit 8fi#parse argumentfor arg in "$@"doargkey="${arg:0:2}"argvalue="${arg#*=}"if [ "${argkey}" == "-i" ]; then UNINSTALL_FOR_INSTALL=0echo "uninstall for install"elif [ "${argkey}" == "-d" ]; thenUUID=${argvalue}elif [ "${argkey}" == "-u" ]; thenAEGIS_UPDATE_SITE_ARRAY=(${argvalue//|/ })echo "specify udpate domain argument is ${argvalue}"else# old AliYunDun just send uuid as argumentUUID="${arg}"fidoneecho "uuid is ${UUID}"stop_aegis_pkillwait_aegis_exituninstall_serviceremove_aegisumount ${AEGIS_INSTALL_DIR}/aegis_debugprintf "%-40s %40s\n" "Uninstalling aegis" "[ OK ]"# report uninstall resultif [ -n "${UUID}" -a "${UNINSTALL_FOR_INSTALL}" != 0 ]; thenreport_uninstall_resultfi

Windows

:: -i : uninstall before install, do not delete domaincfg.iniecho offtaskkill /F /IM AliHips.exe"C:\Program Files (x86)\Alibaba\Aegis\AliHips\AliHips.exe" --stopdriversc stop "Alibaba Security Aegis Detect Service"sc delete "Alibaba Security Aegis Detect Service"taskkill /F /IM AliYunDunUpdate.exetaskkill /F /IM AliYunDun.exetaskkill /F /IM AliYunDunMonitor.exetaskkill /F /IM AliSecGuard.exetaskkill /F /IM AliNetFilter.exetaskkill /F /IM AliDetect.exetaskkill /F /IM AliScriptEngine.exe::wait aegis exitecho "begin to wait AliYunDun.exe exit"timeout 10 > NULtasklist|find /i "AliYunDun.exe"if %errorlevel% == 0 (echo "wait AliYunDun.exe exit fail, possibly due to self-protection, please uninstall or disable self-protection from the aegis console."exit /b 1)sc stop "Alibaba Security Aegis Update Service"sc delete "Alibaba Security Aegis Update Service""C:\Program Files (x86)\Alibaba\Aegis\AliNet\AliNetFilter.exe" --stopdriverset driver_onwer_file_path="C:\Program Files (x86)\Alibaba\Aegis\AliSecGuard\driver_owner.txt"set driver_onwer_path="C:\Program Files (x86)\Alibaba\Aegis\AliSecGuard\AliSecGuard.exe"if exist %driver_onwer_file_path% (for /f "usebackq delims=" %%i in (%driver_onwer_file_path%) do (set driver_onwer_path="%%i"))::echo %driver_onwer_path%%driver_onwer_path% --stopdriverrmdir /s /q "C:\Program Files (x86)\Alibaba\Aegis\aegis_client"rmdir /s /q "C:\Program Files\Alibaba\Aegis\aegis_client"timeout 3 > NULrmdir /s /q "C:\Program Files (x86)\Alibaba\Aegis\aegis_client"rmdir /s /q "C:\Program Files\Alibaba\Aegis\aegis_client"rmdir /s /q "C:\Program Files (x86)\Alibaba\Aegis\aegis_update"rmdir /s /q "C:\Program Files\Alibaba\Aegis\aegis_update"rmdir /s /q "C:\Program Files (x86)\Alibaba\Aegis\alihids"rmdir /s /q "C:\Program Files\Alibaba\Aegis\alihids"del /f "C:\Windows\temp\singleApp_aegisClient"del /f "C:\Windows\temp\single_app_yun_dun_monitor"if not "%1" == "-i" (del /f "C:\Program Files\Alibaba\Aegis\globalcfg\domaincfg.ini"del /f "C:\Program Files (x86)\Alibaba\Aegis\globalcfg\domaincfg.ini") else (exit /b)if "%1" == "" (exit /b)::Invoke-WebRequest is supported from powershell 3.0, so server 2008 and below is not supportset uuid=%1powershell -executionpolicy bypass -c "Invoke-WebRequest -Uri https://update.aegis.aliyun.com/update -Method POST -ContentType 'application/json' -Body '{\"version\": 4,\"data\": {\"uuid\": \"%uuid%\", \"type\": \"uninstall\"}}'"

下载仅供下载体验和测试学习,不得商用和正当使用。

[ppwp passwords=”zhishitu.cn”]

下载体验

应版权要求,禁止分享,敬请谅解,有问题务必找客服哈。

如何获取解压密码

有问题找客服哈,并领取学习福利!

[/ppwp]

点击下载

小鱼网是一个美好的开源学习社区,学习编程,学习WordPress,下载WordPress插件主题,
小鱼网 » 阿里云服务器卸载–AliYunDun阿里云盾

常见问题FAQ

发表回复

分享最优质的学习资料

立即查看 了解详情