Solved Enable AppArmor or SELinux on Ubuntu 16.04 LTS

  • Hi there and welcome to PC Help Forum (PCHF), a more effective way to get the Tech Support you need!
    We have Experts in all areas of Tech, including Virus removal, Crash Fixing and BSOD's , Microsoft Windows, Computer DIY and PC Hardware, Networking, Gaming, Tablets and iPads, General and Specific Software Support and so much more.

    Why not Click Here To Sign Up and start enjoying great FREE Tech Support.

    This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Status
Not open for further replies.

jmarket

PCHF Owner
PCHF Owner
Support Team
Security Team
Jan 10, 2015
1,483
395
PCHF Bunker
pchelpforum.net
#6
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.

1. Stop the AppArmor script in /etc/init.d/

Code:
sudo /etc/init.d/apparmor stop

2. Purge AppArmor from the system.

Code:
 sudo apt purge apparmor

If you want to keep AppArmor's config files, use the below command instead:

Code:
sudo apt remove apparmor

3. Update and reboot your system

Code:
sudo apt update && upgrade -yuf
sudo reboot

4. Install SELinux

Code:
sudo apt install selinux
sudo reboot

5. You can determine whether or not SELinux is enforcing security on your system by trying to set SELinux to enforcing mode.

Code:
[email protected]:~# sudo setenforce 1
[email protected]:~# sudo getenforce
Enforcing

6. 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
 
Status
Not open for further replies.