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.重启系统 reboot和(终端指令为 init 6)。
 

猜你喜欢

转载自blog.csdn.net/qq_33468857/article/details/131132734