# Running ethereal with root privaleges while non-root user??

## carlos123

I have a catch-22 type of situation that I would appreciate input on.  

How do I run ethereal with root privaleges while logged into KDE as a regular user?  

"kdesu ethereal" doesn't work.  Ethereal just won't open up. 

Running "ethereal" from a su'd root prompt won't work.  Can't open X it says.  

And I just run ethereal wtihout root privaleges it won't let me start a packet capture at all.  

Any suggestions short of logging out and out of everything I am doing and logging in as root entirely? 

Thanks. 

Carlos

----------

## sefd

i had the same problem with another application. i think that's because root is not allowed to connect to the X-server. runing

```
xhost +local:root
```

as normal user while X is running did it for me

----------

## deboeck

Hi,

kdesu does work for me. I created a shortcut with the command "/usr/kde/3.3/bin/kdesu /usr/bin/ethereal". Maybe it's worthwile figuring out while kdesu doesn't work for you ? Is your regular user part of the wheel group ? This is required for su.

Cheers,

Steven

----------

## carlos123

Yeah my regular user is part of the wheel group.  In fact I can su to a root prompt just fine from a Konsole.  So that's definitely not the problem per se.  

I got no clue why Alt+F2 and then entering "kdesu ethereal" only shows me a log in box to enter the root password and that's it. No ethereal.  

I'll try the actual full path invocation through a command prompt and see if that gets me anywhere.  

Thanks. 

Carlos

----------

## carlos123

Here's what I get when running your command string from a command prompt...

```

carlos@oak - /home/carlos

> /usr/kde/3.3/bin/kdesu /usr/bin/ethereal

kdesu: WARNING: Could not start daemon, reduced functionality.

carlos@oak - /home/carlos

>

```

No clue as to what is wrong.  

Carlos

----------

## d_m

I used to use Ethereal at work all the time. I would log into GNOME, open a terminal, and do "sudo ethereal&" and it would work for me. Have you tried this?

Good luck.

----------

## carlos123

Well considering that I don't run GNOME and that I cannot therefore use a "su" command in a GNOME window of any sort I guess your solution does not quite work for me eh?  :Smile: 

If I enter "kdesu ethereal" into a KDE run command window I am asked for my root user name and then .... nothing .... nothing shows up.  

Carlos

----------

## kill

What d_m is refering to has nothing to do with gnome. He set up sudo which will allow him to run programs with root priviliges.  sudo ethereal& starts ethereal as the root user and detaches it from the console.

----------

## carlos123

Oops!  Sorry about that.  :Embarassed:    I misunderstood what he meant.  

Thanks for the input ya all. 

Carlos

----------

## carlos123

I emerged sudo and tried it and what a quirky program.  I give up!  

It let me enter my root password but would not recognize it (no my caps lock wasn't on).  

Then it popped out of the password prompt and showed my password in the clear on the screen and then complained that my password as a program could not be found.  

Oh well.  I guess I will resort to running ethereal as the root user by logging in as the root through KDE.  

Thanks ya all. 

Carlos

----------

## d_m

Sorry I should have been more clear:

The sudo program allows you (if you have permission to su to root) to enter your own password to gain root priveleges for the program you run. It is like kdesu except that instead of entering the root password you enter your own.

Also, I should not have told you to use the "&".. that was why your password showed up in the terminal. My apologies.

Using that program I was able to run ethereal as root in an X session which was for a normal user.

I hope you are able to resolve your problem.

----------

## carlos123

Thanks for the clarification d_m.  Much appreciated.  

Here's my latest and greatest attempt   :Smile: .  

```

carlos@oak - /home/carlos

> sudo ethereal

We trust you have received the usual lecture from the local System

Administrator. It usually boils down to these two things:

        #1) Respect the privacy of others.

        #2) Think before you type.

Password:

sendmail: Cannot open mail:25

carlos is not in the sudoers file.  This incident will be reported.

carlos@oak - /home/carlos

>

```

I got a real laugh out of the system telling me it was going to report me.  That's cute.  But still no ethereal.  

The password I entered this time was the one for carlos, which is the user I usually log in as.  

Not sure where the sudoers file is but I guess I can use find or locate to take a look for it.  

Any other suggestions as to how to get sudo to work?  

Thanks. 

Carlos

----------

## d_m

Yeah, you have to edit /etc/sudoers and uncomment a line. I recommend the line that gives full access to all in the wheel group (those who can su).

```
# Uncomment to allow people in group wheel to run all commands

%wheel  ALL=(ALL)       ALL
```

Sorry, if I had realized you hadn't used sudo before, I would have offered more advice. Also, I apologize again for telling you to put "&" in the command. That's usually a bad idea with sudo'd applications.

Good luck.

P.S. Here's why your password was visible (and not sudo's fault). When you type "sudo ethereal &", the shell starts "sudo ethereal" and then immediately puts it in the background. The command asks for your password, which you see printed. However, stdin is no longer attached to the command but just to the shell (because the process is in the background), so when you type your password, it shows up like any command you type. And when you hit enter, the shell tries to execute the command. That's why using sudo and & doesn't work.

----------

## carlos123

Thanks very much for your additional input d_m.  Your hired!!!   :Smile: .  

You know I've been thinking of signing in under a different user name as my "guru" status might be causing people to think I am actually some kind of guru.  In some things I am but in other things I most certainly am not and am more like a Gentoo babe in diapers  :Smile: . 

Given that sudo will open up ALL users of the wheel group to be able to run every command I am not sure I will want to do that.  I'll have to think about that some.  While I am the main one that runs on my computer, others do use it from time to time (and I have made them members of the wheel group so that if they get stuck I can su to a root prompt) and I am not sure I want them to have the potential of messing up my system.  

I also am trying to set up my Gentoo system in such a way that I can simply ghost the Gentoo install to a different drive and install the drive at local businesses such that they can be up and running as quickly as possible.  I would not want to have to change the sudoers file every time I do that or have to remember that I am running under sudo differently than business clients might want to run. 

Anyway thanks again d_m.  I know there was a way to run ethereal under a regular user because I used to do it quite often back when I was using ethereal more often.  I just can't remember how to do that under KDE.  

KDE seems to be getting so full of quirks lately that I am emerging GNOME to see if that might not be a better desktop, more stable and less prone to errors caused by non-programmers developing applications or changing things under KDE, for business use.  In recent times it seems like every time I have upgraded KDE through emerge that my system has broken somehow and has required a fair amount of time for me to get KDE back up to being usable again.  The latest versions all cause the panels to just disappear on me for no apparent reason or otherwise crashing applications that have been stable.   I end up being stuck having to go back to using KDE 3.1.4a even though I have the latest versions emerged.  

Carlos

----------

