Skip to main content

Disable the firewall and SELinux

This topic describes how to disable the firewall and SELinux. If you are a personal user, you can skip this step. If you are an enterprise user, it is recommended that you refer to this topic to disable the firewall and SELinux.

Disable the firewall

Run the following commands in sequence to disable the firewall:

systemctl disable firewalld 
systemctl stop firewalld
systemctl status firewalld

Disable SELinux

Run the following command to open the /etc/selinux/config configuration file:

vi /etc/selinux/config

Modify the corresponding configuration item in the /etc/selinux/config configuration file to the following:

SELINUX=disabled

Run the following command or restart the server to make the changes take effect:

setenforce 0

Run the following command to check whether the changes have taken effect:

sestatus