On Wed, Feb 28, 2001, Tzafrir Cohen wrote about "Xauthority question":
> Hi
> 
> I would like to run some X apps from a 'su -' shell xterm.
> 
> I used to use the following trick to save myself the need of messing with
> xauth:
> 
> in the root shell I set:
> 
>   DISPLAY=:0.0
>   XAUTHORITY=/home/tzafrir/.Xauthrity
> 
> (since root can read the user's home directory)
> 
> However, this doesn't work anymore. Any idea if there is any way to make
> it work?

This should work, and in fact the easiest thing for you to do... How come
it stopped working? Try fixing your spelling to ".Xauthority", not
".Xauthrity" :)
Also, try replacing :0.0 with localhost:0.0 or machine:0.0 - maybe that
would work (but it's only a desperate try).

> If not, can anybody give me the required xauth commands? (Yes, I tried the
> man page, but I didn't fully understand it).
> 
> Thanks

'xauth l' just lists the MIT magic cookies you have: for each DISPLAY you have
some long hex key (displays written as .../unix are used when X is using a
unix domain socket, i.e., when :0.0 is used without a machine name).

But 'xauth l' is just for information. To send a Xauthority key to a different
user (or machine), do something like
        xauth auth extract - $DISPLAY | su -c xauth merge -

This is similar an example in xauth(1).  If after this machine:0.0 works
but :0.0 does not, maybe you'll need a second line similar to the above
but with machine/unix:0.0 instead of $DISPLAY - I'm not sure.

By the way, if this is personal machine (with no other users), you can just
do something like 'xhost +localhost'. Looks scary, but perfectly acceptable
for a single-user host (I would suggest to firewall the X-Windows ports from
the outside, just in case you accidentally do something like 'xhost +').

-- 
Nadav Har'El                        |        Thursday, Mar 1 2001, 6 Adar 5761
[EMAIL PROTECTED]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |A diplomat thinks twice before saying
http://nadav.harel.org.il           |nothing.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to