How to find the status of SELinux?
$ cat /selinux/enforce
The above command will print 0 or 1 which means,
0 – permissive mode
1 – enforcing mode
How to disable SELinux?
$ echo 0 > /selinux/enforce
The above command temporarily turns off the enforcement. To switch it back,
$ echo 1 > /selinux/enforce
If you want to permanently set the value of selinux to permissive mode, then type
Edit the file by setting by changing the variable’s value
The above setting will print the warning message only. If you want to disable the SELinux completely, then set the variable’s value to ‘disabled’. If you set it to disabled, then there will be additional steps involved in bringing it back to “enforcing” as all files that have been changed after disabling SELinux have to have its status set to enforcing mode.
Now reboot the system for the changed setting to take effect.
If you had disabled SELinux earlier and wanted to reset the settings to permissive/enforcing mode, then follow the link below