How to Disable SELinux on Centos 8
Learn to Disable SELinux on Centos 8 by following simple steps on command line. This guide helps you disable the Security enhanced Linux in 2 minutes.
- Published
- Updated
- Reading time
- 2 min

Security-Enhanced Linux (SELinux) is an access control mechanism in the Linux kernel that provides security policies. While it’s an effective tool that prevents malicious software from accessing users’ ssh keys and sensitive information, SELinux adds another level of complexity for system administration; configuring it may prove challenging and it may create compatibility issues between some older apps that rely on it and more modern ones; for this reason some administrators choose to turn SELinux off altogether. This piece will explain how you can disable SELinux on Centos 8
This article will explain how to disable SELinux on Centos 8. While this process is simple, you must only do it if absolutely necessary; disabling SELinux leaves your system more exposed so it is important that before taking this step it be thoroughly considered why or where.
Linode images used by most CentOS 8 systems by default enable SELinux; you can check its status with getenforce and sestatus commands.
To completely turn off SELinux, edit the below given file with a text editor and change SELINUX=disabled; however, this method only disables it at boot time; it does not alter your current SELinux policy.
/etc/selinux/config
To permanently change SELinux to permissive mode, edit the /etc/selinux/config with a text editor such as nano. Change any SELINUX=enforcing entries with either “permissive” or “disabled”. Save and reboot your server.
/etc/selinux/config
Permissive mode in SELinux permits all actions that would otherwise be denied in enforce mode, yet logs any violations of its policies. This mode can be helpful when troubleshooting denials; oftentimes denials occur because an application was trying to do something explicitly allowed within its policy. For more detailed analysis on why certain denials occur, consider installing setroubleshoot suite of tools.
If you need to enable SELinux again, rebooting and reactivating its services are both good ways of doing so. Alternatively, use the setenforce command to return SELinux back into enforce mode.
In this article, you learned how to disable SELinux on CentOS 8 servers for maximum server protection without compromising functionality. By following this article and the related tips provided herein, you can ensure your server receives maximum level protection without compromising functionality or becoming vulnerable for breaches. In future articles we’ll also cover other topics like virtualization and containers so if any questions arise please leave your thoughts below – we would love to hear from you!
Written by
A Computer Science Graduate, who works extensively on open source projects. His Areas Of interest are: Network Security, Linux Administration, FOSS, Python, and C programming.
More from Ajay →$ grep -r "linux" ~/articles
Keep reading

7 Best Linux network monitor tools for system administrators
Network performance assessment is a critical task for system administrators. System admins are often required to master more than one Linux network monitor…
5 min read

Best Linux distro for programming and developers.
The embroidered flexibility of Linux makes it an ideal platform for coding and software development. But you have so many choices between Linux distribution…
4 min read

9 Must-Have Termux Hacking Tools for Ethical Hackers
There are many Termux hacking tools online, but be wary when downloading. Some may simply be clickbait or force users to install malware onto their devices…
3 min read
