AppArmor is a mandatory access control (MAC) framework that restricts the actions of applications on an Ubuntu system, preventing them from accessing unauthorized files, folders, or other system resources. Here are the steps to enable AppArmor on Ubuntu:
- Check whether AppArmor is installed on your system or not by running the following command in the terminal:sudo dpkg -l apparmor
If it is not installed, install it by running the following command:sudo apt-get install apparmor
- Once AppArmor is installed, you can enable it by editing the GRUB configuration file. Open the file /etc/default/grub using any text editor with root privileges. For example:sudo nano /etc/default/grub
- Find the line that begins with GRUB_CMDLINE_LINUX_DEFAULT and add the security=apparmor parameter to the end of the line. The line should look like this:GRUB_CMDLINE_LINUX_DEFAULT="quiet splash security=apparmor"
- Save the file and exit the text editor.
- Update GRUB by running the following command in the terminal:sudo update-grub
- Restart your Ubuntu system for the changes to take effect.
AppArmor is now enabled on your Ubuntu system. You can create profiles for individual applications using the
aa-genprof tool, or use pre-existing profiles located in the