In this post I will show you how to easily disable SELinux without having to reboot your Centos environment. In other words, we will be changing the mode from enforcing to permissive.
To check if SELinux is enabled and the configurations of SELinux you can simply type the following:
sestatus
You should see something like this:
ELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31
Finally, to disable SELinux without having to reboot your server simply run this command:
setenforce 0
Now we can run sestatus again and you should see the current mode is set to permissive which means it will not block anything but will warn you instead.
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: permissive
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31