- Product Bulletin
- Service Overview
-
User Guide
- Usage Overview
- Selecting HCE as the Public Image When Creating an ECS
- Changing an OS to HCE
- Migrating an OS
- Upgrading HCE and RPM Packages
- Security Updates for HCE
- Obtaining the openEuler Extended Software Packages
- Creating a Docker Image and Starting a Container
- Tools
- Kernel Functions and Interfaces
- xGPU
- Configuring the Repositories and Installing Software for HCE
-
FAQs
- What Do I Do If CentOS Linux Is No Longer Maintained?
- Does Huawei Cloud Have a Migration Solution for CentOS?
- How Do I Install the MLNX Driver?
- How Do I Enable SELinux on an ECS Running HCE?
- How Do I Change the OS Name on the Console After the OS Is Migrated?
- How Are Huawei Cloud EulerOS, EulerOS, and openEuler Different from One Another?
- How Do I Enable WireGuard in Kernel and Install wireguard-tools?
- How Do I Save the User Credential Information for Logging In to Docker Like What Docker CE Does?
- What Is OOM? Why Does OOM Occur?
- How Do I Handle IPVS Errors?
- Why Can't HCE Obtain an IPv6 Address After IPv6 Is Enabled for an ECS?
- How Do I Set Auto Log Using TMOUT?
- Best Practices
- General Reference
Show all
Copied.
How Do I Enable SELinux on an ECS Running HCE?
By default, SELinux is disabled on HCE. You can enable SELinux as needed.
Do not run the /etc/selinux/config command to enable SELinux. If you enable SELinux by running this command, login may fail.
Procedure
- Open the configuration file /boot/grub2/grub.cfg and delete selinux=0.
- Run the touch /.autorelabel command.
The /.autorelabel file triggers the OS to relabel all files on the disk during startup. This process may take several minutes. After the relabel operation is complete, the OS automatically restarts for the operation to take effect and deletes the /.autorelabel file to ensure that the relabel operation will not be performed again.
- Open the configuration file /etc/selinux/config, set SELINUX to permissive, and run the reboot command to restart the OS.
- Open the configuration file /etc/selinux/config, set SELINUX to enforcing, and run the reboot command to restart the OS.
- Run the getenforce command to check the SELinux status.
If Enforcing is displayed, SELinux is enabled.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot