[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: another Xauthority problem?



First thing is: are you su-ing and then running emacs? When you su you lose your
XAUTHORITY environment variable. The variables points to a file which is used to
authenticate you to the X server. What's more, the permissions on xauthority files are
set 600 so that only the user logged in can access them (naturally). If you're su-ing
to root this doesn't pose a problem since root can read any file. If you're su-ing to
another user you'll have to extract the proper auth record and put it into the target
user's xauthority file (or disable X security--not recommended).

So step by step: do you have an XAUTHORITY environment var?

echo $XAUTHORITY

If you don't, you need one. If you logged in with xdm then you should have an
xauthority file as ~/.Xauthority. Check to see if this file exists. Now set

export XAUTHORITY=<path to xauthority file>

Try again to run program. If it doesn't work then perhaps you don't have permission to
the file or there's no entry for your display. Run 'xauth' and at the prompt type
'list'. Do you see an entry for the DISPLAY you're trying to use? If you're trying to
reach the server running on same machine you'll be interested in the '<machine
name>/unix:0' entry most likely. If this entry isn't there then you'll have to get it
by exporting the entry from the correct xauthority file and importing it into your
xauthority file.

Chris Evans wrote:

> I have got Debian Hamm and X up and working and am really
> pleased.  With help from the list I have got the recompile for SMP
> working and got X launching.  However, I still have an X problem
> and can't work out the answer from the archives or the doc files I've
> found.
>
> The problem is under fvwm but occurs under olwm too.  I can
> launch emacs as a regular user (or su) from the window manager
> drop down menu but when I try to invoke it from the xterm
> command line I get:
>
> Xlib: connection to ":0.0" refused by server
> Xlib: invalid MIT-MAGIC-COOKIE-1 key
> emacs: cannot connect to X server :0.
>
> I've tried resetting the environment variable DISPLAY from 0.0 to 0
> and to psyctc1.sghms.ac.uk (address of the machine, vague
> recollections from using an Xserver on an Windoze box to access X
> clients on Sun (or maybe it was SG?) in the past).
>
> Something very similar happens with xedit.
>
> Archive entries seem to say something about an .Xauthority file
> which my ordinary user account doesn't have. Same thing happens
> after su in xterm though.
>
> I am sure I'm getting my permissions wrong but can't find the
> magic key or magic cookie.  Anyone put me straight?!
>
> Chris
>
> --
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null



--
Jens B. Jorgensen
jjorgens@bdsinc.com



--  
Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null


Reply to: