LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Issues with sudo and Gnome apps (https://www.linuxquestions.org/questions/linux-security-4/issues-with-sudo-and-gnome-apps-558852/)

livewire98801 06-03-2007 01:48 PM

Issues with sudo and Gnome apps
 
For a very long time, I've been using the sudo command to avoid logging in as root. I prefer to do this on the local machine rather than logging out and logging into Gnome as root. I also have to do this when using ssh -X to connect remotely, as I ALWAYS disable root access over ssh.

I've been running into a problem on Gnome 2.16 and above on Fedora and Ubuntu where the act of trying to launch a GUI based program with sudo generates the following error:

Code:

Xlib: connection to ":0.1" refused by server
I solved the problem by commenting out the following in /etc/sudoers:

Code:

Defaults    env_reset
Defaults    env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \
                        LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \
                        LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \
                        LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \
                        LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \
                        _XKB_CHARSET"

Can anyone tell me if there is any reason that this will cause a problem? I can't see anything in there that is paticularly important, but I'm not sure what some of it is. Otherwise, is there a better solution than this?

I should point out that I've done this on one Fedora machine, and I haven't done it on my Ubuntu machine yet, so I don't know if this is going to be a solution there or not.

wjevans_7d1@yahoo.co 06-03-2007 06:13 PM

I don't know anything about gnome, but it occurs to me that some important environment variable is being lost unless you comment out those lines in /etc/sudoers.

Try this: At the point where you would normally issue the sudo command, do this first:

Code:

env | sort > somefile
Then browse through somefile to see whether any environment variable rings a bell. If nothing does, then post (copy 'n' paste) the entire content of somefile to this thread, and we can take a look at it.


All times are GMT -5. The time now is 01:31 PM.