• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to Permanently Disable SELinux in Rocky Linux 9.2

  • 00:35 cat /etc/os-release
  • 00:58 sestatus
  • 01:23 dnf install -y grubby
  • 01:42 grubby --update-kernel ALL --args selinux=0
  • 02:05 reboot
  • 02:19 sestatus
{{postValue.id}}

To permanently disable SELinux in Rocky Linux 9.2

Introduction:

SELinux stands for Security-Enhanced Linux. It is a security feature implemented in certain Linux distributions, including Red Hat Enterprise Linux (RHEL), Fedora, CentOS, and others. SELinux provides an additional layer of security by enforcing mandatory access control (MAC) policies.

Installation Procedure:

Step 1: Check the version of OS by using the below command

[root@Linuxhelp ~]# cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.2 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.2"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.2 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.2"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.2"

Step 2: Check the status of SElinux by using the below command

 [root@Linuxhelp ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      33

Step 3: Install grubby Command, To disable SELinux in Red Hat Linux 9 based distros, by using the below command

 [root@Linuxhelp ~]# dnf install -y grubby
Last metadata expiration check: 2:16:33 ago on Fri 21 Jul 2023 03:58:16 PM IST.
Package grubby-8.40-63.el9.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Step 4: Execute the below command to permanently disable SELinux

 [root@Linuxhelp ~]# grubby --update-kernel ALL --args selinux=0

Step 5: Reboot your machine now by using the below command

 [root@Linuxhelp ~]# reboot

Step 6: Again, verify the status of SELinux by using the below command

 [root@Linuxhelp ~]# sestatus
SELinux status:                 disabled

SELinux has been permanently disabled.

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to Permanently Disable SELinux in Rocky Linux 9.2. Your feedback is much welcome.

Tags:
michael
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

Is SELinux enabled by default on Rocky Linux 9.2?

A

Yes, SELinux is enabled by default on Rocky Linux 9.2. This means that when you install the operating system, SELinux will be in enforcing mode to provide a higher level of security

Q

How can I check the status of SELinux on Rocky Linux?

A

You can check the SELinux status by running the following command in the terminal:
sestatus

Q

How can I change the SELinux mode on Rocky Linux 9.2?

A

vi /etc/selinux/config
# Change SELINUX=enforcing to SELINUX=permissive
# Save the file and exit the editor
sudo reboot
After the reboot, SELinux will be in permissive mode.

Q

What are the different SELinux modes?

A

SELinux operates in three modes: enforcing, permissive, and disabled.

Q

How can I manage SELinux policies on Rocky Linux 9.2?

A

You can use the semanage and semodule utilities to manage SELinux policies.
semanage allows you to configure SELinux policy modules and specific policy settings, while semodule helps manage SELinux policy modules.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Gibbson ?
How do i run both nginx and apache in same instance on centos

Hi...,

my server is based centos operating system and my webserver is already running on Apache.... i need to run both apache and nginx on same instance ... please help me to implement this concept...

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.