您尚未登录。

#1 2024-08-08 12:23:33

bubblebbbbbb
会员
注册时间: 2023-01-18
帖子: 4

无法在Hyprland中使用sudo打开wireshark

在使用x11+dwm时,可以通过终端运行sudo wireshark正常启动wireshark抓包,但在换成Hyprland后,wireshark可以通过wofi和终端直接运行命令启动,但不使用sudo就无法抓网卡的包,即使是安装了polkit程序并按照wiki所述运行以下命令:

$ sudo groupadd wireshark
$ sudo usermod -a -G wireshark $USER
$ sudo chgrp wireshark /usr/bin/dumpcap
$ sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap

运行时的报错信息如下:

Authorization required, but no authorization protocol specified

 ** (wireshark:16963) 12:23:08.470353 [GUI WARNING] -- could not connect to display :1
 ** (wireshark:16963) 12:23:08.470374 [GUI WARNING] -- From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
 ** (wireshark:16963) 12:23:08.470407 [GUI ERROR] -- This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, xcb, wayland-egl, wayland.

 ** (wireshark:16963) Aborting on fatal log level exception
fish: Job 1, 'sudo wireshark' terminated by signal SIGABRT (Abort)

离线

#2 2024-08-08 12:40:33

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,852
个人网站

Re: 无法在Hyprland中使用sudo打开wireshark

不要用 sudo 运行它……什么 wiki 教你手动操作的啊?看看有问题时的以下命令输出:

ls -l /usr/bin/dumpcap
getcap /usr/bin/dumpcap
id

另外 wireshark 不用 polkit 的……

离线

页脚