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:
Xlib: connection to ":0.1" refused by server
I solved the problem by commenting out the following in /etc/sudoers
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 \
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.