1、使用apt-get install wireshark之后如果使用普通用户运行报如下错误:
The capture session could not be initiated on interface ‘wlan0’ (You don’t have permission to capture on that device).
Please check to make sure you have sufficient permissions, and that you have the proper interface or pipe specified.
2、使用网上建议执行如下命令
gpasswd -a user root
gpasswd -a user wireshark
无效
3、使用setcap ‘CAP_NET_RAW+eip CAP_NET_ADMIN+eip’ /usr/bin/dumpcap
普通用户user可以正常使用。
4、以上原因是因为能力(capability) (POSIX 1003.1e, capabilities(7))用更小的粒度控制超级管理员权限。
1)从2.1版开始,Linux内核有了能力(capability)的概念,即它打破了UNIX/LINUX操作系统中超级用户/普通用户的概念,由普通用户也可以做只有超级用户可以完成的工作.
2)capability可以作用在进程上(受限),也可以作用在程序文件上,它与sudo不同,sudo只针对用户/程序/文件的概述,即sudo可以配置某个用户可以执行某个命令,可以更改某个文件,而capability是让某个程序拥有某种能力,例如:
capability让/tmp/testkill程序可以kill掉其它进程,但它不能mount设备节点到目录,也不能重启系统,因为我们只