歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu下安裝和使用Wireshark

Ubuntu下安裝和使用Wireshark

日期:2017/2/28 15:34:11   编辑:Linux教程

用Ubuntu Software Center安裝wireshark還是很容易的,在教育網下使用ipv6的軟件源速度也很好。

但是安裝完後如果不進行任何設置的話,wireshark還是不能使用。這時打開wireshark會提示“thereare no interfaces on which a capture can be done”。

這是因為在默認情況下,普通用戶沒有截取網絡數據的權限。

當然,可以通過運行sudowireshark,這樣可以正常使用wireshark,但這並不是一個好方法,正如wireshark提示的那樣:

“Running as user "root" andgroup "root".

This could be dangerous.

If you're running Wireshark this way inorder to perform live capture, you may want to be aware that there isa better way documented at

/usr/share/doc/wireshark-common/README.Debian”

參照/usr/share/doc/wireshark-common/README.Debian和網絡上的資料:

wireshark利用了優先級分離(privilegeseparation)的策略,不同的進程會有不同的優先級。

Role
PrivilegeLevel
Description

Capture
OS-dependent
Readslive capture data

Dissection
Non-privilegeduser, possibly chrooted
Dissectspacket data. The majority of Wireshark's security-related bugshave been in its dissection code.

Filesystem
Normaluser
Normalfile-handling, e.g. reading and writing capture files,preferences, etc.

抓取實時數據的dumpcap進程就需要超級用戶的權限。如果想讓普通用戶也能正常使用wireshark,建議的方法是把用戶加入wireshark組,這樣當用戶運行wireshark時,dumpcap進程會以有高優先級,而其他相關進程仍然只有普通用戶的權限。

運行sudo dpkg-reconfigurewireshark-common會創建wireshark用戶組。

把需要運行wireshark的用戶加入wireshark組:

sudo usermod -a -G wireshark $USER

之後,重新以該用戶身份重新登錄即可。

Copyright © Linux教程網 All Rights Reserved