On Ubuntu 16.04, how do I enable AppArmor or SELinux? Itβs not in the Ubuntu App Store it wonβt even work in Terminal. How do I enable one of them?
Enable AppArmor or SELinux on Ubuntu 16.04 LTS
Collapse
X
-
Tags: None
-
I donβt run Ubuntu.
AppArmor is enabled by default.
Source: AppArmor - Ubuntu Wiki
AppArmor support was first introduced in Ubuntu 7.04, and is turned on by default in Ubuntu 7.10 and later.
Ubuntu Manpage: AppArmor - kernel enhancement to confine programs to a limited set of resources.
Ubuntu Manpage: apparmor.d - syntax of security profiles for AppArmor.Comment
-
You can not use AppArmor and SELinux together. Itβs one or the other.
AppArmor is enabled by default on kernels 2.6.36 and later. SELinux has to be manually installed.
If you wish to do so, you may follow the below instructions at your OWN RISK. I or anyone at PCHF assumes no responsibility for what may happen.- Stop the AppArmor script in /etc/init.d/
[ICODE]sudo /etc/init.d/apparmor stop[/ICODE]- Purge AppArmor from the system.
[ICODE] sudo apt purge apparmor[/ICODE]
If you want to keep AppArmorβs config files, use the below command instead:
[ICODE]sudo apt remove apparmor[/ICODE]- Update and reboot your system
Code:sudo apt update && upgrade -yuf sudo reboot
- Install SELinux
Code:sudo apt install selinux sudo reboot
- You can determine whether or not SELinux is enforcing security on your system by trying to set SELinux to enforcing mode.
Code:pchf@ubuntu:~# sudo setenforce 1 pchf@ubuntu:~# sudo getenforce Enforcing
- To maintain enforcing mode after reboot, modify the SELinux configuration file in /etc/selinux/config from the default SELINUX=permissive to SELINUX=enforcing
Code:# 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
Comment
-
-
It seemed like AppArmor was already running by default so I decided to leave it as it is when I installed Ubuntu.Comment
Comment