ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
## **关闭防火墙** 1\. 先查看防火墙状态 ``` systemctl status firewalld ```  ... Active:active (running)since ... 开启状态  ... Active:inactive (dead)since ... 关闭状态 2\. 关闭防火墙 ``` systemctl stop firewalld ``` 3\. 查看防火墙服务是否开机启动 ``` systemctl is-enabled firewalld ``` 4\. 关闭防火墙开机启动 ``` systemctl disable firewalld ``` ## **二、关闭SELinux** 1\. 查看当前SELinux状态 ``` getenforce ``` 2\. 暂时关闭SElinux ``` setenforce 0 ``` 3\. 编辑配置文件,更改为SELINUX=disabled 永久关闭SElinux ``` vim /etc/selinux/config ``` 内容如下 ``` # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=permissive #修改此参数 宽容模式(permissive) 强制模式(enforcing) 关闭(disabled) # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted ``` 其他 1:查看防火状态 systemctl status firewalld service  iptables status 2:暂时关闭防火墙 systemctl stop firewalld service  iptables stop 3:永久关闭防火墙 systemctl disable firewalld chkconfig iptables off 4:重启防火墙 systemctl enable firewalld service iptables restart   5:永久关闭后重启 //暂时还没有试过 chkconfig iptables on [Linux关闭防火墙命令\_baidu\_36124158的博客-CSDN博客\_linux 关闭防火墙命令](https://blog.csdn.net/baidu_36124158/article/details/90603496)