天天看點

Linux Centos-7 關閉selinux。(臨時關閉和永久關閉)

1.檢視selinux狀态,打開終端,輸入getenforce,回車,顯示Enforcing。

getenforce
           

2.臨時關閉,在終端輸入setenforce 0。

setenforce 0
           

3.永久關閉,在終端輸入vim /etc/selinux/config,回車,

vim /etc/selinux/config
           

(1)向下箭頭,選到SELINUX=enforcing這一行,鍵盤摁I鍵,進入插入狀态,

(2)将SELINUX=enforcing改為SELINUX=disabled,

(3)摁Esc鍵,再摁:鍵,輸入wq(注意小寫),回車

4.重新開機系統(終端指令為 init 6)。

繼續閱讀