我要评分
获取效率
正确性
完整性
易理解

Disabling SELinux

The Kunpeng DevKit checks whether the SELinux enforcing mode is enabled in the OS. To disable the SELinux enforcing mode, perform the following operations:

  • Disabling SELinux temporarily
    1. Query the SELinux status:
      1
      sestatus
      

      If the value of Current mode is enforcing, the SELinux enforcing mode is enabled.

    2. Set the SELinux mode to permissive:
      1
      setenforce 0
      
    3. Query the SELinux status again.

      If the value of Current mode is permissive, the SELinux enforcing mode is disabled temporarily.

    The setting becomes invalid after the server is rebooted. When the tool is used, service exceptions may occur.

  • Disabling SELinux permanently
    1. Query the SELinux status:
      1
      sestatus
      

      If SELinux status is enabled, SELinux is enabled.

    2. Open the /etc/selinux/config file:
      1
      vi /etc/selinux/config
      
    3. Press i to enter the insert mode and change SELINUX=enforcing to SELINUX=disabled.
    4. Press Esc, type :wq!, and press Enter to save the file and exit.
    5. Restart the server.
      1
      reboot
      
    6. Query the SELinux status again.

      If SELinux status is disabled, SELinux is disabled.