8

I need to change selinux to "permissive mode" on a production server without a reboot, but setenforce wont let me do it(as a root), it always prints "setenforce: SELinux is disabled" What i'm doing wrong?

[root@server3 ~]# setenforce 0
setenforce: SELinux is disabled
[root@server3 ~]# setenforce 1
setenforce: SELinux is disabled
[root@server3 ~]# setenforce Permissive
setenforce: SELinux is disabled
[root@server3 ~]# getenforce
Disabled
Crazy_Bash
  • 227
  • 1
  • 4
  • 9

3 Answers3

8

setenforce can only be used to change the mode SELinux is running in. It cannot be used to enable SELinux.

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
4

So, SELinux must first be enabled as follow:

sudo nano /etc/selinux/config

then change

SELINUX=disabled

into

SELINUX=permissive

and reboot.

After reboot, you should have

# getenforce
Permissive
TerDale
  • 189
  • 1
  • 7
1

setenforce 0 (Does not require reboot) and then check sestatus