This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Running tshark as a root, dofile file is disabled problem

1

Whenever i try to analyze packets using tshark on Ubuntu with root permission i got the following error, however when i switch to user profile (su berkey), there is no problem. Why this occurs? is there a solution?

tshark: Lua: Error during loading: [string "/usr/share/wireshark/init.lua"]:45: dofile has been disabled Running as user "root" and group "root". This could be dangerous.

asked 23 Dec '12, 03:53

berkey's gravatar image

berkey
31448
accept rate: 0%

edited 23 Dec '12, 03:53


4 Answers:

2

If you're not using any lua scripting with Tshark, then all is fine. Tshark just protects you from running a script (with endless possibilities to mess up your system if programmed badly) with root privileges. You can ignore the warning in that case.

If you do run lua scripts, it is strongly advised to change your system to be able to do capturing and analysis without root privileges.

If you do need to run Tshark with root privileges and lua scripts, then you need to patch the Tshark source code to remove the root-check...

answered 23 Dec '12, 04:17

SYN-bit's gravatar image

SYN-bit ♦♦
17.1k957245
accept rate: 20%

thanks i don't use any Lua commands. Your answer solved my question.

(23 Dec '12, 08:52) berkey

2

Whenever i try to analyze packets using tshark on Ubuntu with root permission

Don't do that. Instead, give dumpcap the privileges it needs to capture traffic without requiring root privileges.

answered 24 Dec '12, 02:37

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

0

fix lua error:

cd /usr/share/wireshark

nano init.lua

line #29 change to:

disable_lua = true

answered 28 Oct '13, 05:15

oops13's gravatar image

oops13
112
accept rate: 0%

edited 28 Oct '13, 05:16

0

I just commented out the dialog line.

From:

dofile = function() error("dofile has been disabled") end

To:

-- dofile = function() error("dofile has been disabled") end

answered 07 Dec '14, 11:48

Kennybobs's gravatar image

Kennybobs
111
accept rate: 0%