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

migrated from stackoverflow.com Mar 20 '12 at 5:38

This question came from our site for professional and enthusiast programmers.

  • Might have something to do with SELinux hooking into the kernel? Sounds plausible to me, perhaps someone will know for sure. – SpacemanSpiff 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. – Matthew Ife Mar 22 '12 at 15:45

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


So, SELinux must first be enabled as follow:

sudo nano /etc/selinux/config

then change




and reboot.

After reboot, you should have

# getenforce
  • 3
    Notice the Q states w/o a reboot. – slm Sep 2 '15 at 20:10

As far as I know, it is not possible.

SELinux is a core feature of the kernel, meaning it's status change will always require a reboot to be set to enabled or disabled.

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.