How To Disable Selinux Permanently Or Temporally On CentOS 7

How To Disable Selinux Permanently Or Temporally On CentOS 7

SELinux is a part of Enhanced Security in Linux. There is some reason for disabling it on the server as sometimes this creates an issue in running an application. There’re two SELinux modes in Linux and how to check SELinux status. There’s an SELinux policy defined in Linux. Sometimes, SELinux is not enforcing because you need to reboot the machine to make changes in SELinux. Let’s see how to disable SELinux.

Check Out: How To Install PHP 7.2 Using Repository In Ubuntu 19.04

When SELinux is disabled, the SELinux policy won’t be loaded. I would recommend not to disable it, So, you always use permissive mode for troubleshooting or make it temporary disable.

Benefits of SELinux

  • Reduce vulnerability
  • Selinux used to enforce data confidentially and integrity.
  • All processes and files labeled with type.

Check Out: SElinux “ Semanage Command Not found “

SELinux file location /etc/sysconfig/selinux

You can find the SELinux mode by command line getenforce so

disable selinux centos 7

So, you can else set Selinux via command line

setenforce 0 for permissive mode

selinux status check

setenforce 1 for enforcing mode

selinux status check

Check Out: Error “ Failed to load SELinux Policy freezing “

For troubleshooting purposes, you have to keep SELinux in permissive mode. so

You can also change SELinux status from making changes in a file. so

vim /etc/sysconfig/selinux

Check Out: Reinstall SElinux Policy

If you want to disable Selinux, So you will have to reboot it. SELinux disabled

You’re done d disable selinux centos 7 selinux status check selinux is not enforcing selinux modes in linux selinux policy in linux

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment