Opening GUI as another user

Felipe Figueiredo philsf at
Wed Sep 20 04:22:55 UTC 2006

Em Wednesday 20 September 2006 01:05, Rob Blomquist escreveu:
> On Tuesday 19 September 2006 10:51, Henri Girard wrote:
> > on sudo user run :
> > xhost +
> > and then on test : DISPLAY=:0 firefox
> > good luck
> root at timmy:~# xhost +
> xhost:  unable to open display ""
> root at timmy:~# DISPLAY=:0 firefox
> Xlib: connection to ":0.0" refused by server
> Xlib: Invalid MIT-MAGIC-COOKIE-1 key
> So what do I need to do to get this to work?

You have to run xhost as the user currently logged in X (not even root has 
access to it).

But you should specify the host being permitted, as xhost offers some 
protection for X in a networked environment, by automatically blocking 
untrusted connections. Try  xhost + localhost, or xhost + timmy, or the 
correct hostname and stick with 

Note that this is all obsolete when you are running gui programs in a remote 
host, because SSH can automatically forward the X connection, taking care of 
everything, but it appears not to be your case.


More information about the kubuntu-users mailing list