Selinux Rocky Linux
Introduction
SELinux
stands for Security-Enhanced Linux. Linux with enhanced security is an implementation of a mandatory access control system that can work alongside the classic discretionary access control system.
You can learn more about what SELinux is
here
conf
vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Check the status
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: permissive Policy MLS status: enabled Policy deny_unknown status: allowed Memory protection checking: actual (secure) Max kernel policy version: 33
Switch Selinux to permissive mode
Manually or with the help of sed replace SELINUX=enforcing with SELINUX=permissive
sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
setenforce
Check the change
sestatus | grep "Current mode"
Current mode: permissive
Turn off the computer
sudo shutdown -r now
Disable Selinux
Manually or with the help of sed replace SELINUX=enforcing with SELINUX=disabled
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
sudo shutdown -r now
Check
sestatus
SELinux status: disabled
Article author: Andrei Olegovich