linux无root抓包,linux下wireshark不用sudo權限抓包包

本文提供两种解决Wireshark无法直接以图标方式启动的问题的方法。第一种涉及更改配置以允许非超级用户运行Wireshark;第二种则通过创建特定组并调整权限实现。这两种方法均能有效解决启动问题。

ubuntu安裝了wireshark,發現打不開網絡接口,后來從網上得知要用sudo從命令行執行,確實可以,但是執行過程中一直要開一個命令行窗口,不爽,想直接用單擊圖標的方法運行之,在網上查詢找到以下兩個方法,

1.這個主要涉及到安全的問題,可以開啟非超級用戶模式,這樣就可以直接使用普通用戶進行包采集了。具體操作如下:

sudo dpkg-reconfigurewireshark-common(出現一個帶顏色的對話框,用方向鍵把紅色指示塊移到YES上回車就ok了)

sudo adduser yournamewireshark (把yourname換成你自己的用戶名)

這樣就可以了~~

2.

First, create awireshark group

:~$ sudo groupaddwireshark

Second, add yourusername to the wireshark group

:~$ sudo usermod -a -Gwireshark yourusername

Third, change groupownership of dumpcap to wireshark group

:~$ sudo chgrpwireshark /usr/bin/dumpcap

Fourth, set filepermissions of dumpcap to 754 (rwx for user, r-x for group)

:~$ sudo chmod 754/usr/bin/dumpcap

Fifth, enable filecapabilities for dumpcap

:~$ sudo setcap'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/dumpcap

You may also need torun dpkg-reconfigure for wireshark-common if you install wireshark or tshark asa package through Synaptic and enable packet capture for non-root users

:~$ sudodpkg-reconfigure wireshark-common

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值