In this tutorial you will learn how to disable AppArmor for a particular process or how to disable it entirely on Ubuntu 20.04 Focal Fossa Linux.
In this tutorial you will learn:
- How to disable AppArmor for a particular process
- How to disable AppArmor completely
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa |
Software | AppArmor |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
How to disable AppArmor on Ubuntu 20.04 step by step instructions
- First check the current status of the AppArmor on your Ubuntu 20.04 system:
$ sudo apparmor_status
- In this step we will disable AppArmor for a single process/profile. If you wish to disable AppArmor for an entire system skip this step and proceed to
Step 3 .To disable AppArmor only for a particular process first list all available profiles:
$ ls /etc/apparmor.d/ abstractions lsb_release usr.bin.evince usr.lib.libreoffice.program.senddoc usr.sbin.cups-browsed usr.sbin.rsyslogd disable nvidia_modprobe usr.bin.firefox usr.lib.libreoffice.program.soffice.bin usr.sbin.cupsd usr.sbin.tcpdump force-complain sbin.dhclient usr.bin.man usr.lib.libreoffice.program.xpdfimport usr.sbin.ippusbxd local tunables usr.lib.libreoffice.program.oosplash usr.lib.snapd.snap-confine.real usr.sbin.mysqld
For example we will now disable AppArmor for a MySQL server:
$ sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ $ apparmor_parser -R /etc/apparmor.d/disable/usr.sbin.mysqld
Executing the
apparmor_status
now should not list the/usr/sbin/mysqld
in the enforce mode. - To disable AppArmor completely execute:
$ sudo systemctl disable apparmor
- Reboot your system.