#查看防火墙状态(Centos 6)
iptables -S
#查看防火墙状态(Centos 7)
firewall-cmd --list-all
关闭selinux
setenforce 0
vi /etc/selinux/config 将SELINUX=enforcing改为SELINUX=disabled
或者
sed -i ‘s/^SELINUX=enforcing$/SELINUX=permissive/’ /etc/selinux/config

centos 7
CentOS 7.0默认使用的是firewall作为防火墙
启动一个服务: systemctl start firewalld.service
关闭一个服务: systemctl stop firewalld.service
重启一个服务: systemctl restart firewalld.service
显示一个服务的状态: systemctl status firewalld.service
在开机时启用一个服务: systemctl ena
本文介绍了如何在CentOS 6和7中查看和关闭防火墙。对于CentOS 6,可以使用iptables命令查看防火墙状态;在CentOS 7中,则需用firewall-cmd。此外,还提供了关闭SELinux的步骤,包括临时关闭和修改配置文件以永久关闭。
订阅专栏 解锁全文
615

被折叠的 条评论
为什么被折叠?



