SELinux in Ubuntu Lab
The following can be completed with Ubuntu 22.x or later.
Installing and Enabling SELinux
The first step is to install SELinux. Start by opening a command line terminal and installing the necessary packages with the apt commands below.
Activate SELinux
Execute the following command with root permissions to enable SELinux on the system.
Enforcing Mode
Set SELinux to enforcing mode:
Reboot your system. The relabelling will be triggered after you reboot your system. When finished the system will reboot one more time automatically.
Check SELinux status with the following command to ensure that it is in enforcing mode. $ sestatusDisabling SELinux
To disable SELinux open up the /etc/selinux/config
configuration file and change the following line:
FROM:
TO: Reboot your system for the changes to take effect.Alternatively you can temporarily put SELinux into permissive mode with the following command.
Note this change will not be persistent (i.e., survive a reboot). It will go back to enforcing later. To enable SELinux again just execute: