xhost: unable to open display ":0.0"

David Kramer david at thekramers.net
Sat Sep 10 22:49:54 EDT 2005


jbk wrote:
> jbk wrote:
>> David Kramer wrote:
>>> I assume you started X as a regular user.  That regular user has to 
>>> adjust the security of the X session, not root.  Put the "xhost 
>>> +localhost" in _that_ user's .bash_profile.
>>
>>
>> It is. In fact if I just "su" instead of "su -" I have no problem.
> 
> I just discovered a subtilety in the behavior. If I "su -" directly from 
> user I do not have the problem. It is when I first "su" and then "su -" 
> that xhost is unable to open the display.
> So does this narrow the possibilities? I have two Fc4 systems I can 
> compare. Or should I leave it as a quirk that isn't worth figuring out?

Ummm, did you try what I already suggested?

It's not a quirk.  Whoever starts X is the only one who has rights to talk 
to X, or enable others to talk to X.  What's the mystery?

The "-" in "su -" means "Make the shell a login shell", which is straight 
out of the man page.  When you  "su", you are elevating your rights to that 
of root.  When you "su -", you *become* root.  There is no subtlety.  You 
are no longer you.



More information about the Discuss mailing list