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