Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Host Security Service/ FAQs/ Agent/ How Do I Uninstall the Agent?

How Do I Uninstall the Agent?

Updated on 2025-01-07 GMT+08:00

Two uninstallation methods are available: one-click uninstallation and manual local uninstallation.

Scenario

  • The agent was installed using an incorrect package and you need to uninstall it.
  • The agent was installed using incorrect commands and you need to uninstall it.
  • If the agent fails to be upgraded, uninstall the agent.

Prerequisites

When you uninstall the agent on the management console, the Agent Status of the server is Online.

Uninstalling the Agent on the Console in One-Click

You can uninstall an HSS agent from the HSS console.

NOTE:

After the agent is uninstalled from a server, HSS will not provide any protection for the server.

  1. Log in to the management console.
  2. In the upper left corner of the page, select a region, click , and choose Security & Compliance > HSS.
  3. In the navigation pane, choose Installation & Configuration > Server Install & Config.
  4. In the Operation column of the target server, click Uninstall Agent.

    If you need to uninstall agents in batches, you can select servers and click Uninstall Agent above the list.

  5. In the displayed dialog box, click OK.

    In the server list, if Agent Status of the server is Not installed, its agent is successfully uninstalled.

Uninstalling the Agent from the Server

You can manually uninstall an agent on a server when you no longer use HSS or need to reinstall the agent.

NOTE:

After the agent is uninstalled from the target server, HSS will not provide any protection for the server.

  • Uninstalling the Linux agent
    1. Log in to the server from which you want to uninstall the agent and run the following command to switch to user root:

      su - root

    2. Perform the following operations to stop HSS:
      1. Run the following command to stop the service:

        /etc/init.d/hostguard stop

      2. (Optional) Enter the verification code displayed in the command output. See Figure 1.
        This operation is required only for servers where HSS self-protection is enabled.
        Figure 1 Verification code
    3. In any directory, run the following command to uninstall the agent:
      NOTE:

      Do not run the uninstallation command in the /usr/local/hostguard/ directory. You can run the uninstallation command in any other directory.

      • For EulerOS, CentOS and Red Hat, or other OSs that support RPM installation, run the rpm -e hostguard command.
      • For Ubuntu and Debian OSs, or other OSs that support DEB installation, run the dpkg -P hostguard command.

      If information similar to the following is displayed, the agent has been successfully uninstalled. If the uninstallation fails, go to the step 3.

      Stopping Hostguard...
      Hostguard stopped
      Hostguard uninstalled.
    4. (Optional) If the agent fails to be uninstalled in step 2, perform the following operations to uninstall the agent:
      • For OSs that support RPM installation, such as EulerOS, CentOS, and Red Hat,
        1. Run the following command to delete the installation record:

          rpm -e --justdb hostguard

        2. Run the following command to check whether there are hostguard processes:

          ps -ef | grep hostguard

          If there are residual processes, run the kill -9 PID command to stop all residual processes.

        3. Run the following command to check whether the /usr/local/hostguard directory exists:

          ll /usr/local/hostguard

          If the directory exists, run the rm -rf /usr/local/hostguard command to delete it.

        4. Run the following command to check whether the /etc/init.d/hostguard file exists:

          ll /etc/init.d/hostguard

          If the file exists, run the rm -f /etc/init.d/hostguard command to delete the file.

      • For OSs that support DEB installation, such as Ubuntu and Debian.
        1. Run the following command to check whether there are hostguard processes:

          ps -ef | grep hostguard

          If there are residual processes, run the kill -9 PID command to stop all residual processes.

        2. Run the following command to check whether the /usr/local/hostguard directory exists:

          ll /usr/local/hostguard

          If the directory exists, run the rm -rf /usr/local/hostguard command to delete it.

        3. Run the following command to check whether the /etc/init.d/hostguard file exists:

          ll /etc/init.d/hostguard

          If the file exists, run the rm -f /etc/init.d/hostguard command to delete the file.

  • Uninstalling the Windows agent
    1. (Optional) Disable HSS self-protection.

      If HSS self-protection is enabled, disable it and then uninstall the agent. Otherwise, the agent cannot be uninstalled locally on the server. For details about how to disable the function, see How Do I Disable Self-Protection?

    2. Log in to the server that you want to uninstall the agent.
    3. Click Start and choose Control Panel > Programs. Then select HostGuard and click Uninstall.
      NOTE:
      • Alternatively, go to the C:\Program File\HostGuard directory and double-click unins000.exe to uninstall the program.
      • If you have created a folder for storing the agent shortcut under the Start menu when installing the agent, you can also choose Start > HostGuard > Uninstall HostGuard to uninstall HostGuard.
    4. In the Uninstall HostGuard dialog box, click Yes.
    5. (Optional) Restart the server.
      • If you have enabled WTP, you need to restart the server after uninstalling the agent. In the Uninstall HostGuard dialog box, click Yes to restart the server.
      • If you have not enabled WTP, you do not need to restart the server. In the Uninstall HostGuard dialog box, click No to skip server restart.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback