==
tcpdump 权限拒绝
目录权限拒绝
tcpdump不能工作在enforce模式下,于是改为使用complain模式:
==
这是Ubuntu系统下的权限管理framework “AppArmor” 中设置了tcpdump 工作在enforce模式,其不能正常工作于是报错:
查看当前工作模式,修改成功兼容模式 如下
$ sudo apparmor_status
apparmor module is loaded.
10 profiles are loaded.
10 profiles are in enforce mode.
/sbin/dhclient3
/usr/bin/evince
/usr/bin/evince-previewer
/usr/bin/evince-thumbnailer
/usr/lib/NetworkManager/nm-dhcp-client.action
/usr/lib/connman/scripts/dhclient-script
/usr/lib/cups/backend/cups-pdf
/usr/sbin/cupsd
/usr/sbin/tcpdump
/usr/share/gdm/guest-session/Xsession
0 profiles are in complain mode.
1 processes have profiles defined.
1 processes are in enforce mode :
/usr/sbin/cupsd (1240)
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
$ sudo vim /sys/kernel/security/apparmor/profiles
/usr/bin/evince-thumbnailer (enforce)
/usr/bin/evince-previewer (enforce)
/usr/sbin/tcpdump (enforce)
/usr/bin/evince (enforce)
/usr/sbin/cupsd (enforce)
/usr/lib/cups/backend/cups-pdf (enforce)
/usr/lib/connman/scripts/dhclient-script (enforce)
/usr/lib/NetworkManager/nm-dhcp-client.action (enforce)
/sbin/dhclient3 (enforce)
/usr/share/gdm/guest-session/Xsession (enforce)
tcpdump不能工作在enforce模式下,于是改为使用complain模式:
$ sudo aa-complain tcpdump
Setting /etc/apparmor.d/usr.sbin.tcpdump to complain mode.
$ sudo apparmor_status
apparmor module is loaded.
10 profiles are loaded.
9 profiles are in enforce mode.
/sbin/dhclient3
/usr/bin/evince
/usr/bin/evince-previewer
/usr/bin/evince-thumbnailer
/usr/lib/NetworkManager/nm-dhcp-client.action
/usr/lib/connman/scripts/dhclient-script
/usr/lib/cups/backend/cups-pdf
/usr/sbin/cupsd
/usr/share/gdm/guest-session/Xsession
1 profiles are in complain mode.
/usr/sbin/tcpdump
1 processes have profiles defined.
1 processes are in enforce mode :
/usr/sbin/cupsd (1240)
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
===