How to disable selinux on Centos7 machine without reboot/restart ?

How to disable selinux on Centos machine without reboot/restart ?

In this article we will explain how to disable selinux on Centos 7 machine without server restart/reboot.

You can check if “selinux” is enabled , by using following command

In the above example , selinux is enabled on the machine

Now we will disable it by running following command

Now check again

You can see that selinux is disabled now. This change is not permanent. ie, this will go away during next systsem restart/reboot. So let us make this change permanent

Open file /etc/sysconfig/selinux using vi editor

Comment out following line

Add the following line

After making the changes, file will be like following


Then, save and exit the file. This way we ensure that “selinux” will be disabled even after the next server reboot.

Leave a Reply

Your email address will not be published. Required fields are marked *