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
2
  • Might have something to do with SELinux hooking into the kernel? Sounds plausible to me, perhaps someone will know for sure. Mar 20 '12 at 5:42
  • If selinux is disabled at boot the machine will have to be reoboted in order to enable it again. Mar 22 '12 at 15:45
8

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

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
1
  • 3
    Notice the Q states w/o a reboot.
    – slm
    Sep 2 '15 at 20:10
1

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.