臨時和永久關閉firewalld與selinux

CentOS6
service iptables stop #這個命令可以臨時關閉防火牆

chkconfig iptables off #這個命令可以永久關閉防火牆

chkconfig iptables --list #這個命令可以查看防火牆的狀態

CentOS7
systemctl stop firewalld #臨時關閉

systemctl disable firewalld #永久關閉,即設置開機的時候不自動啓動 重啓後生效

setenforce 0 是臨時關閉,重啓後selinux又由處於開啓狀態
永久關閉selinux CentOS6可以使用vi命令打開vi /etc/selinux/config CentOS7可以使用vi命令打開/etc/sysconfig/selinux 文件將SELINUXTYPE=(disable或permissive)
臨時和永久關閉firewalld與selinux

重啓查看已生效。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章