Estos contenidos se han traducido de forma automática para su comodidad, pero Huawei Cloud no garantiza la exactitud de estos. Para consultar los contenidos originales, acceda a la versión en inglés.
Centro de ayuda/ Elastic Cloud Server/ Preguntas frecuentes/ OS Management/ OS Faults/ How Can I Enable SELinux on an ECS Running CentOS?
Actualización más reciente 2023-08-08 GMT+08:00

How Can I Enable SELinux on an ECS Running CentOS?

Symptom

SELinux is disabled on ECSs running CentOS 7.5 by default. After I enable SELinux by running /etc/selinux/config and enter the login password, the login failed.

This section describes how to resolve this issue based on enabled SELinux.

Solution

The operations described in this section are performed on ECSs running CentOS 7.5.

  1. Run the following command to change SELINUX=disabled in the SELinux configuration file to SELINUX=enforcing:

    vim /etc/selinux/config

  2. Run the following command to automatically enable SELINUX on the file system upon ECS restarting:

    touch /.autorelabel

  3. Run the following command to restart the ECS to make the configuration take effect:
    reboot

    After the preceding command is executed, the system automatically restarts twice.