Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-01-2003, 09:06 PM   #1
Bruce Hill
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,937

Rep: Reputation: 128Reputation: 128
How to start synaptic logged in as user...

Sorry for the double post, but I just realized this is not a Debian specific issue, and I won't get many reads in Debian.

This error message appears when I try to use synaptic now.

debian:/home/servant# synaptic
Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server
synaptic:could not open display

Somewhere I read that you must login as root to use synaptic for some reason after something, but I can't find it by searching Google/linux and here. I know the answer is out there, but apparently I'm not entering the right information in my search.

Could someone tell me what it is that I need to change, to run synaptic as root in a terminal but logged in as a user? I'm still Googling and searching as I post.

Old 08-01-2003, 09:20 PM   #2
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Here's what's happening.

When you have an Xserver running, you have a display referenced by the DISPLAY variable.

The user who logged into the Xsession makes connections to $DISPLAY and the Xserver allows the client program to connect using MIT-MAGIC-COOKIES which are to be found in the originating user's $HOME/.Xauthority file.

So if you su to another user and want to start an X program, like synaptic, you have to make sure that the DISPLAY variable is set in order to reference the correct Xserver DISPLAY (could be the local one, or one on the other side of the Internet) and also that you are authorized to do so.

The way that this is easily achieved is by the user who started the Xsession to issue the command

xhost + $HOST

to allow any user on the host reference by $HOST (which should be set to the name of the localhost) to access the resources of his display.

But note that this does have security implications, since it means that any user on the authorized machine can run a program to connect to your
DISPLAY and change any of your X properties and even run a program to capture what is on your screen.

Also, if HOST is not set, the above command become

xhost +

which allows any machine whatsoever to connect.

So please exercise caution.

Last edited by Corin; 08-01-2003 at 09:22 PM.
Old 08-01-2003, 09:44 PM   #3
Bruce Hill
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,937

Original Poster
Rep: Reputation: 128Reputation: 128
Old 01-26-2006, 11:45 PM   #4
Registered: Sep 2004
Location: Seattle area
Distribution: debian stable
Posts: 47

Rep: Reputation: 15
I'm using debian sarge, and was able to get this to work by issuing:

"xhost + local:localhost"

I can now run synaptic from the kde konsole, where I do most of my root-stuff.

I'm still trying to figure out where I should put this so that it initializes this way every time. Somewhere in the KDE initialization would be nice.

I thinks it's worth quoting something I found at

QUOTE> Using "xhost +" allows anyone the ability to watch your keystrokes, capture windows and insert command strings into your windows. This situation is particularly bad when you have root access to a machine. There is no legitimate reason to run "xhost +". <QUOTE

Of course, that's from their perspective. Some might argue that the inability to figure out the intricacies of using "xhost + What-Exactly-Do-I-Type-Here-To-Make-It-Work???" might be a very legitimate reason to just use "xhost +". So if "xhost + local:localhost" doesn't work for you... good luck!!!


Last edited by demerson3; 01-27-2006 at 12:09 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-user and 3D sharing, 3D only works for the first logged in user foxy123 SUSE / openSUSE 0 02-20-2005 04:31 AM
When a user last logged in turbo_acura Linux - General 1 09-21-2004 12:02 PM
User listed as logged on, even though he's not fishsponge Linux - Security 4 07-19-2004 09:51 AM
kde much slower to start when logged in as alan than logged in as root arubin Slackware 0 04-26-2004 04:27 PM
mozilla works fine when logged in as a user but crashes when logged in as root jimi Linux - General 6 04-02-2003 08:34 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration