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

Re: Xlib: Invalid MIT-MAGIC-COOKIE-1 key

On 31 Aug 1998, Eric Jacoboni wrote:

> I've some problems with some programs under X : when i try to run
> xosview, for exemple, i get the following message :
> =-=-=-=-=-=-=-=-=
> titine:~# Xlib: connection to ":0.0" refused by server
> Xlib: Invalid MIT-MAGIC-COOKIE-1 key
> Can't open display named 
> =-=-=-=-=-=-=-=-=
> Since i'm new to the Debian system, i'd like to know where to
> configure such an information.


Let me guess.. you start x as normal user (or login with xdm as user) and
then you su to root and try to run X11 programs as root on the display
that is owned by the user?  That won't work.

You'll have to do this:

  $ su -
  # export $DISPLAY=:0
  # export $XAUTHORITY=/home/user/.Xauthority
  # some-xclientprog &

Substitute the right username for user in the line above.
Only root can do this, because root can read anybody's files, even if the
files are mode 600 (shows up in "ls -l" as r------ - readable only for the
owner of the files.) 

Alternatively, install ssh.  Ssh (among other things) does connection
forwarding for xclients.)  With ssh it would work like this:

  $ ssh -l root localhost
  # some-xclientprog &



Reply to: