How to Install SELinux on Ubuntu 18.04 LTS


SELinux Ubuntu has a Mandatory Access Control (MAC) framework like SELinux, named AppArmor. Both SELinux and AppArmor give a bunch of apparatuses to seclude applications from one another to shield the host framework from being undermined. AppArmor offers Ubuntu clients required admittance control alternatives, without the apparent trouble or expectation to absorb information that SELinux may have. Notwithstanding, in the event that you are changing to Ubuntu 18.04, are now acquainted with SELinux, and might want to utilize it to implement security on your framework, you can introduce it by following the means in this guide.


In this post, We will install SElinux in ubuntu 18.04 LTS


Step 1: Update and Upgrade the System


You need to update and upgrade the default packages by using the given command.

$ sudo apt-get update && sudo apt-get upgrade -y 


Step 2: Uninstall AppArmor


By default Apparmor is installed in your ubuntu machine, You need to stop the service and uninstall the AppArmor by following the given command.

$ sudo systemctl stop apparmor
$ sudo apt-get --purge remove apparmor -y


Step 3: Restart the Machine


To get changes you need to reboot the ubuntu machine by execution given command.

$ sudo reboot

Step 4: Install SELinux


You are ready to install the SElinux packages and dependencies by following the given command. 

$ sudo apt-get install selinux selinux-basics selinux-utils audispd-plugins auditd  -y 


Step 5 : Restart the Machine


SElinux installed but to work proper you need to again reboot your ubuntu machine.

$ sudo reboot

Step 6: Get SELinux Status


Verify the SElinux status by execution of the given command.

$ sudo sestatus



In this post, We have successfully installed SElinux on ubuntu 20.04 LTS server, Still you have any question, Please leave a comment.


How to Install SELinux on Ubuntu 18.04 LTS

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top