firewalld是centos自帶防火墻,關(guān)掉它,本地環(huán)境可以隨意配置端口訪問(wèn),
1.檢測(cè)是否開(kāi)啟了firewall
systemctl status firewalld.service
2.停止firewall?
systemctl stop firewalld.service
3.禁止firewall開(kāi)機(jī)自啟?
systemctl disable firewalld.service
4.iptales
Redhat使用了SELinux來(lái)增強(qiáng)安全,關(guān)閉的辦法為:
1. 永久有效
修改 /etc/selinux/config 文件中的 SELINUX="" 為 disabled ,然后重啟。
2. 即時(shí)生效
setenforce 0
關(guān)閉防火墻的方法為:
1. 永久性生效
開(kāi)啟:chkconfig iptables on
關(guān)閉:chkconfig iptables off
2. 即時(shí)生效,重啟后失效
開(kāi)啟:service iptables start
關(guān)閉:service iptables stop
需要說(shuō)明的是對(duì)于 Linux 下的其它服務(wù)都可以用以上命令執(zhí)行開(kāi)啟和關(guān)閉操作
補(bǔ)充:
a. 防火墻還需要關(guān)閉ipv6的防火墻:
chkconfig ip6tables off
并且可以通過(guò)如下命令查看狀態(tài):
chkconfig --list iptables
b. selinux狀態(tài)可以通過(guò)以下命令查看:
sestatus