The objective of this article is to install, enable and disable SELinux on Ubuntu 20.04 Focal Fossa Linux.
In this tutorial you will learn:
- How to install SELinux
- How to enable SELinux
- How to how to disable selinux
π Enabled SELinux on Ubuntu 20.04 Focal Fossa Linux
Enabled SELinux on Ubuntu 20.04 Focal Fossa Linux
Software Requirements and Conventions Used
| Category | Requirements, Conventions or Software Version Used |
|---|---|
| System | Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa |
| Software | SELinux |
| Other | Privileged access to your Linux system as root or via the sudo command. |
| Conventions |
# β requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ β requires given linux commands to be executed as a regular non-privileged user |
How to disable/enable SELinux on Ubuntu 20.04 step by step instructions
Enable SELinux
- The first step is to install SELinux. Use the
aptcommand to install the following packages:$ sudo apt install policycoreutils selinux-utils selinux-basics
- Activate SELinux:
$ sudo selinux-activate
- Next, set SELinux to enforcing mode:
$ sudo selinux-config-enforcing
- Reboot your system. The relabelling will be triggered after you reboot your system. When finished the system will reboot one more time automatically.
-
Check the selinux status:
$ estatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: default Current mode: enforcing Mode from config file: error (Success) Policy MLS status: enabled Policy deny_unknown status: allowed Memory protection checking: requested (insecure) Max kernel policy version: 31
Disable SELinux
- To disable SELinux open up the
/etc/selinux/configconfiguration file and change the following line:FROM: SELINUX=enforcing TO: SELINUX=disabled
- Reboot your system.
