> I finally have xdm running, but I've noticed that the xauth/xhost stuff
> is messed up when X starts from xdm. For example, it I su to some user
> and set my display, then type xv, it says:
> 
> Xlib: connection to ":0.0" refused by server
> Xlib: Client is not authorized to connect to Server
> xv: Can't open display
> 
> before stting up xdm, I would just type 'xhost +' in if I ever saw this.
> But now xhost says the same thing. I've read the man on xhost and xauth
> and can't figure out how to make this work. I don't encounter this at
> all if I start in run level 3 then type 'xstart' at the prompt. Thanks.

you're missing a couple of important nuances.

first, to use 'host based' authentication, you need to run the 'xhost +'
as the user who does have privilege (ie, the id you logged in as).  If you
gave 'justin' to xdm, then 'justin' has to issue the 'xhost +'.  This is
because the X session itself is owned by 'justin'.  Just do a ps aux to
verify.

second, there is another authentication mechanism based on 'MIT magic
cookies' where you can see them in action if you do a 'xauth list'.

Just do something like this before becoming the other user:

xauth extract - `hostname`:0 | su <newuser> -c 'xauth merge -'

(this is also useable across machines if you do something like below.
This is where the real power comes in.)

xauth extract - `hostname`:0 | rsh <newmachine> -l <newuser> 'xauth merge
-'

_____________________   _                    _   _________________________
         Michael Rice  |_|    Collective    |_|  http://www.colltech.com
   [EMAIL PROTECTED]    |_  Technologies  _|    8007598888/8019292 pager 
           Consultant      []            []      "The Power Of Many Minds"   

---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]

Reply via email to