Linux(CentOS7) 關閉防火牆以及關閉Selinux

1、 關閉防火牆並設置開機開不啓動

查看當前狀態

[root@xuegod63 ~]# systemctl status firewalld.service    #查看firewalld狀態

[root@xuegod63 ~]# systemctl stop firewalld       #關閉

[root@xuegod63 ~]# systemctl start firewalld       #開啓

[root@xuegod63 ~]# systemctl disable firewalld     #開機自動關閉   //RHLE7

[root@xuegod63 ~]# chkconfig --list|grep network    #查看開機是否啓動   //RHLE6

[root@xuegod63 ~]# systemctl enable firewalld     #開機自動啓動

 

2、  臨時和永久關閉Selinux

臨時關閉

[root@xuegod63 ~]# getenforce

Enforcing

[root@xuegod63 ~]# setenforce 0

setenforce: SELinux is disabled

永久關閉

[root@xuegod63 ~]# vim /etc/selinux/config  

改:7 SELINUX=enforcing     #前面的7,表示文檔中第7行。方便你查找

爲:7 SELINUX=disabled

[root@xuegod63 ~]# reboot   #重啓主機

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