We can toggle the SELinux state through the
/etc/selinux/config file and reboot the system to have the changes being reflected. But this is not the only way.
On most SELinux enabled systems, we can call the
setenforce command to switch the system between
1) mode. This takes effect immediately, allowing us to easily identify if SELinux is preventing access or not.
Try it out. Switch to the
permissive mode and validate (again using
sestatus, that the SELinux state has indeed been changed immediately as follows:
# setenforce 0
The effect of
setenforce is the same as writing the value into the
/selinux/enforce) pseudo file: ...