45 lines
983 B
Markdown
45 lines
983 B
Markdown
---
|
|
|
|
slug: /disable-firewall-and-selinux
|
|
---
|
|
|
|
# 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:
|
|
|
|
```shell
|
|
systemctl disable firewalld
|
|
systemctl stop firewalld
|
|
systemctl status firewalld
|
|
```
|
|
|
|
## Disable SELinux
|
|
|
|
Run the following command to open the `/etc/selinux/config` configuration file:
|
|
|
|
```shell
|
|
vi /etc/selinux/config
|
|
```
|
|
|
|
Modify the corresponding configuration item in the `/etc/selinux/config` configuration file to the following:
|
|
|
|
```shell
|
|
SELINUX=disabled
|
|
```
|
|
|
|
Run the following command or restart the server to make the changes take effect:
|
|
|
|
```shell
|
|
setenforce 0
|
|
```
|
|
|
|
Run the following command to check whether the changes have taken effect:
|
|
|
|
```shell
|
|
sestatus
|
|
```
|