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

Disabling the Firewall and SELinux

Purpose

  • In the test environment, the firewall is disabled to avoid the network impact. Configure the firewall based on your requirements.
  • SELinux may restrict the access permission of applications. Therefore, disable SELinux to ensure that applications run properly.

    Disabling SELinux may impair system security and make the system more vulnerable to potential security problems and attacks. Assess the potential risks before disabling SELinux.

Procedure

  • Disable the firewall:
    1
    2
    systemctl stop firewalld.service
    systemctl disable firewalld.service
    
  • Disable SELinux.
    • Disable SELinux temporarily (becoming invalid after a server reboot).
      1
      setenforce 0
      
    • Disable SELinux permanently (requiring a server reboot to take effect).
      1. Modify the configuration file to disable SELinux.
        1
        2
        sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
        cat /etc/selinux/config
        

        If "SELINUX=disabled" is displayed, as shown in the following figure, the modification is successful.

      2. Reboot the server.