适用系统:CentOS 7.6功能:彻底关闭firewalld、禁用开机启动、关闭SELinux、清空防火墙规则,交给宝塔云WAF全权防护

补充验证命令(可直接复制执行确认)

# 检查防火墙开机启动状态
systemctl is-enabled firewalld
# 检查SELinux永久配置
cat /etc/selinux/config | grep SELINUX=
补充校验命令(可直接复制执行二次确认)
# 确认防火墙屏蔽锁定状态
systemctl is-masked firewalld
# 确认SELinux永久配置
grep '^SELINUX=' /etc/selinux/config
# 确认防火墙未运行
systemctl is-active firewalld
正确校验命令(替换刚才报错的错误指令)

# 查看防火墙是否运行
systemctl status firewalld
# 查看是否屏蔽锁定
systemctl list-unit-files | grep firewalld
# 查看SELinux永久配置
grep ^SELINUX= /etc/selinux/config
一键汇总校验命令(可直接复制执行)
echo "===防火墙状态==="
systemctl status firewalld | grep -E "Loaded|Active"
echo "===SELinux永久配置==="
grep ^SELINUX= /etc/selinux/config
echo "===SELinux实时状态==="
getenforce
长效校验命令(可留存,后续重启后复测)

# 防火墙完整状态
systemctl status firewalld | grep -E "Loaded|Active"
# SELinux永久配置
grep ^SELINUX= /etc/selinux/config
# SELinux实时状态
getenforce
长效校验命令(可留存,后续重启后复测)
© 版权声明
THE END
暂无评论内容