How to Permanently Disable SELinux in Rocky Linux 9.2
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.
Comments ( 0 )
No comments available