SElinux: How to change to permissive mode without a reboot?
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
Solution 1:
setenforce
can only be used to change the mode SELinux is running in. It cannot be used to enable SELinux.
Solution 2:
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
Solution 3:
setenforce 0 (Does not require reboot) and then check sestatus