linux 关闭防火墙firewall,centos中关闭防火墙(firewall)及SELinux
centos在不斷的版本更新迭代過程中,在centos7中默認使用的是firewall作為防火墻。
centos7關(guān)閉firewall
查看運行狀態(tài):firewall-cmd --state
臨時停止:systemctl stop firewalld.service
啟動:systemctl start firewalld.service
禁止防火墻開機啟動,永久關(guān)閉:systemctl disable firewalld.service
centos6 關(guān)閉iptables
安裝:yum install -y iptables-services
如果centos7也安裝了iptables-services,也可以使用以下命令來關(guān)閉防火墻
1) 即時生效,重啟后復(fù)原
開啟: service iptables start
關(guān)閉: service iptables stop
狀態(tài): service iptables status
2) 永久性生效,重啟后不會復(fù)原
開啟: chkconfig iptables on
關(guān)閉: chkconfig iptables off
3)正確關(guān)閉步驟:
service iptables stop
chkconfig iptables off
SELinux關(guān)閉
查看命令1:getenforce
查看命令2:/usr/sbin/sestatus -v
當返回結(jié)果為Disabled時,為關(guān)閉狀態(tài)
臨時關(guān)閉:setenforce 0
永久關(guān)閉:vim /etc/selinux/config
將SELINUX=enforcing更改為SELINUX=disabled
設(shè)置后需要重啟機器后才能生效。
總結(jié)
以上是生活随笔為你收集整理的linux 关闭防火墙firewall,centos中关闭防火墙(firewall)及SELinux的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: xp 硬盘安装linux双系统,WinX
- 下一篇: linux中特殊字符的含义,Linux中