How to make another user run X clients on the local X server

Alan Coopersmith Alan.Coopersmith at Sun.COM
Mon Jun 23 08:41:16 PDT 2008

Luca Risolia wrote:
> Hello,
> I would like to make a second local user B to run X clients on the local X 
> display/session which is started by the user A.
> After A starts X, what I do is:
> A$ sudo xhost +local:B
> A$ su - B
> B$ xclock
> This way xclock can connect without problems. Now I want to make "xhost 
> +local:B" permanent. 

xhost +local:  adds access for all users of the machine running the X
server - everything after the : is ignored, so +local:B doesn't make
sense.   If you just want to add access for one user, it would be
(assuming recent X & OS), xhost +si:localuser:B or and /etc/X0.hosts
entry of "si:localuser:B".

> This means that /etc/X0.hosts has been read somehow. But this does not seem to 
> be enough. I still have to do a manual "xhost +local" to allow xclock to 
> connect to the server.

There have been some bugs in processing the "local:" entry in /etc/X*.hosts
in some releases (I don't remember which ones off the top of my head).   Try
the "si:localuser:B" format instead.

	-Alan Coopersmith-           alan.coopersmith at
	 Sun Microsystems, Inc. - X Window System Engineering

More information about the xorg mailing list