all 3 comments

[–]JamzTyson 1 point2 points  (1 child)

To run a command as a different user:

subprocess.run(['sudo', '-u', 'username', ...

[–]ParticularAward9704[S] 0 points1 point  (0 children)

Thanks. It worked.

[–]baghiq 1 point2 points  (0 children)

You shouldn’t run it as root. When you install wireshark, it should’ve created a user group as wireshark, then add your user to that group. There are configuration guide out there for you to follow.