Professional Documents
Culture Documents
Learn Linux in One Week and Go From Zero to Hero - Get This Book
Menu
Menu
Aaron Kili Last Updated: July 25, 2019 Linux Commands 5 Comments
Ad
aaPanel - Linux control panel
aaPanel Open
Linux is regarded as one of the most secure operating systems you can use today, that is because of its illustrious
security implementation features such as SELinux (Security-Enhanced Linux).
SELinux offers a means of enforcing some security policies which would otherwise No
not be effectively implemented
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 1/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
by a System Administrator.
When you install RHEL/CentOS or several derivatives, the SELinux feature or service is enabled by default, due to
this some applications on your system may not actually support this security mechanism. Therefore, to make such
applications function normally, you have to disable or turn off SELinux.
Important: If you don’t want to disable SELinux, then you should read the following articles to implement some
mandatory access control on files and services to function properly.
Don’t Miss: Implement Mandatory Access Control with SELinux and AppArmor in Linux
In this how-to guide, we shall walk through steps you can follow to check the status of SELinux and also disable
SELinux in CentOS/RHEL and Fedora, in case it is enabled.
Ad
aaPanel - Linux control panel
aaPanel Open
The first thing to do is to check the status of SELinux on your system, and you can do this by running the following
command:
$ sestatus
Next, proceed to disabling SELinux on your system, this can be done temporarily or permanently depending on what
you want toleft: 549px; top: 32px;height: 15px;width: 60px;
achieve.
ssssss 25 Male
No
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 2/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
# setenforce 0
# setenforce Permissive
These methods above will only work until the next reboot, therefore to disable SELinux permanently, move to the
next section.
To permanently disable SELinux, use your favorite text editor to open the file /etc/sysconfig/selinux as
follows:
# vi /etc/sysconfig/selinux
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 3/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
SELINUX=disabled
Then, save and exit the file, for the changes to take effect, you need to reboot your system and then check the status
of SELinux using sestatus command as shown:
$ sestatus
In conclusion, we moved through the simple steps you can follow to disable SELinux on CentOS/RHEL and Fedora.
There is nothing much to cover under this topic but additionally, finding out more about SELinux can prove helpful
especially for those interested in exploring security features in Linux.
Linux Tricks
How to Fix “Cannot find a valid baseurl for repo” in How to Add Swap Space on Ubuntu
CentOS
If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts?
do ask for help in the comments section.
No
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 4/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
Ad
aaPanel - Linux control panel
aaPanel Open
TecMint is the fastest growing and most trusted community site for any kind of Linux
Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse
the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of
appreciation.
Related Posts
No
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 5/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
No
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 6/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
No
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 7/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
Farhad
July 27, 2021 at 1:29 pm
When you change /etc/sysconfig/selinux, the SELINUX kernel module still will be loaded, just won’t enforce
any policy anymore.
To prevent the whole module from loading we need to add “selinux=0” to the kernel parameters during boot
time or execute this command and reboot the system:
Reply
01101001b
October 9, 2019 at 12:31 pm
left: 549px; top: 32px;height: 15px;width: 60px;
ssssss 25 Male
No
This article proved quite useful to me. Thank you!
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 8/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
Reply
Mik
August 22, 2019 at 7:19 am
Reply
James Stone
July 26, 2019 at 5:02 pm
The only thing you left out is why. Why would you do this?
Reply
Aaron Kili
July 29, 2019 at 10:48 am
@James
This paragraph states the why bit: “When you install RHEL/CentOS or several derivatives, the SELinux
feature or service is enabled by default, due to this, some applications on your system may not actually
support this security mechanism. Therefore, to make such applications function normally, you have to
disable or turn off SELinux.”
Reply
No
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 9/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Notify me of followup comments via e-mail. You can also subscribe without commenting.
Post Comment
This site uses Akismet to reduce spam. Learn how your comment data is processed.
No
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 10/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
No
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 11/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
No
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 12/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
No
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 13/14
10/9/21, 5:53 AM How to Disable SELinux Temporarily or Permanently
How to Add Linux Host to Nagios Monitoring Server Using NRPE Plugin
left: 549px;
How to Install Zabbixtop:on
32px;height:
Debian 10 15px;width: 60px;
ssssss 25 Male
No
Rs 740
https://www.tecmint.com/disable-selinux-in-centos-rhel-fedora/ 14/14