# CentOS7 关闭 selinux、防火墙

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config && \
setenforce 0 && \
systemctl stop firewalld && \
systemctl disable firewalld

提示

查看防火墙是否关闭,没有拦截规则表示关闭

iptables -L

查看 selinux 是否关闭(Mode from config file: disabled)

sestatus