前言 最近有在帮公司制作一个 OpenVpn Snap 安装包,然而频繁遇到了 Apparmor 错误,其实之前安装 Shadowsock 包的时候也见过,但是当时没怎么太认真探究,现在回看起来发现国内这方面的相关资料还是比较少的,本篇博文从介绍到实践由浅到深,帮助自己也帮助读者理解。
错误样例
$ sudo snap install easy-openvpn-server_0.2_amd64.snap --dangerous error: cannot perform the following tasks: - Setup snap "easy-openvpn-server" (unset) security profiles (cannot setup apparmor for snap "easy-openvpn-server": cannot unload apparmor profile: exit status 2 apparmor_parser output: File snap-update-ns.easy-openvpn-server not found, skipping... File snap.easy-openvpn-server.easy-openvpn-server not found, skipping... File snap.easy-openvpn-server.hook.configure not found, skipping... File snap.easy-openvpn-server.hook.connect-plug-firewall-control not found, skipping... File snap.easy-openvpn-server.hook.connect-plug-network-control not found, skipping... File snap.easy-openvpn-server.openvpn not found, skipping... File snap.easy-openvpn-server.status not found, skipping... File snap.easy-openvpn-server.tcp-server not found, skipping... File snap.easy-openvpn-server.udp-server not found, skipping... ) - Setup snap "easy-openvpn-server" (unset) security profiles (cannot unload apparmor profile: exit status 2 apparmor_parser output: File snap-update-ns.easy-openvpn-server not found, skipping... File snap.easy-openvpn-server.easy-openvpn-server not found, skipping... File snap.easy-openvpn-server.hook.configure not found, skipping... File snap.easy-openvpn-server.hook.connect-plug-firewall-control not found, skipping... File snap.easy-openvpn-server.hook.connect-plug-network-control not found, skipping... File snap.easy-openvpn-server.openvpn not found, skipping... File snap.easy-openvpn-server.status not found, skipping... File snap.easy-openvpn-server.tcp-server not found, skipping... File snap.easy-openvpn-server.udp-server not found, skipping... ) - Run configure hook of "easy-openvpn-server" snap if present (run hook "configure": cannot open directory /tmp/snap.0_easy-openvpn-server_XXXXXX: Permission denied) 什么是AppArmor? 1. 安全模型描述 在谈论一个具体的实现之前,避免不了需要了解一下较为完整的背景,AppArmor 作为 Liunx 安全模型中的点亮的某个技能树叉,从操作系统的权限管理与访问机制来入手是一个比较好的选择。其基础的权限管理与访问控制机制和加强的 ACL 机制、SELinux,都对这些安全模型与安全机制有所实现。
...