How to install SELinux on Ubuntu Server 20.04

3 months ago 33

If you've already spent the clip learning SELinux, but person to deploy Ubuntu arsenic a server operating system, you tin instal SELinux and beryllium connected acquainted ground. Jack Wallen shows you how.


Image: GettyImages/Yuichiro Chino

Ubuntu Server has its ain Mandatory Access Control system, called AppArmor, which is akin to SELinux, successful that they some supply tools to isolate applications from 1 another, to support the big system. But however each of these tools is utilized is rather different. In fact, conscionable due to the fact that you cognize one, doesn't mean you'll beryllium capable to instantly usage the other. That's wherefore you mightiness privation to see installing SELinux connected Ubuntu Server. You mightiness beryllium migrating from a Red Hat-based organisation and person invested sizeable clip learning however to usage that peculiar system.

Good happening you tin instal SELinux connected Ubuntu. 

In fact, it's really rather simple, and I'm going to amusement you however it's done. Once finished, you tin commencement moving with SELinux connected Ubuntu Server successful the aforesaid mode you did erstwhile administering your Red Hat-based systems.

What you'll request

To marque this work, you'll request a moving lawsuit of Ubuntu Server 20.04 and a idiosyncratic with sudo privileges. That's it. Let's get to work.

One warning: I highly urge you archetypal effort this connected a trial system. And erstwhile you're definite it volition enactment for you, I would urge you instal SELinux connected a caller instal of Ubuntu Server and past physique from there.

How to region AppArmor

The archetypal happening to bash is region AppArmor. Log into your Ubuntu Server and halt the work with the command:

sudo systemctl halt apparmor

Now we tin region AppArmor with the command:

sudo apt-get region apparmor -y

Once AppArmor has been removed, reboot your strategy with:

sudo reboot

How to instal SELinux

Now we tin instal SELinux. Back astatine the terminal window, contented the command:

sudo apt-get instal policycoreutils selinux-utils selinux-basics -y

When the installation completes, activate SELinux with the command:

sudo selinux-activate

Set SELinux to enforcing mode with:

sudo selinux-config-enforcing

Finally, reboot your strategy erstwhile again with:

sudo reboot

When the strategy comes backmost up, cheque to marque definite SELinux is enabled with the command:


You should spot thing like:

SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux basal directory: /etc/selinux Loaded argumentation name: default Current mode: permissive Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Memory extortion checking: requested (insecure) Max kernel argumentation version: 31

And that's each determination is to instal SELinux connected Ubuntu Server 20.04. If you're already acquainted with this information system, you tin leap successful and commencement securing your server.

Cybersecurity Insider Newsletter

Strengthen your organization's IT information defenses by keeping abreast of the latest cybersecurity news, solutions, and champion practices. Delivered Tuesdays and Thursdays

Sign up today

Also spot

Read Entire Article