Re: magic cookie error
I've seen this question a lot on this list, and although this (xhost) is
a working solution, it seems to be considered to be a bit of a security
hole (anyone logged on to the localhost can access the X-Server, and
thus monitor keys and find out peoples passwords).
If you set the XAUTHORITY variable in your environment as root to be
/<home_path_of_the_person_running_the_xserver>/.Xauthority, eg by
adding:
export XAUTHORITY=/home/<user>/.Xauthority
to the .bashrc of root (if you are using the bash shell), then root can
open windows on user's xserver. Beware, however, that you will have a
problem if you try to start an X-server as root, as it will try and use
an old/non-existent(?) copy of .Xauthority from user's home directory.
To get around this, you would need to unset the XAUTHORITY variable in
root's environment. However, I belive running X as root is also
considered to be the wrong thing to do.
hope this help
Rich
Phil Dyer wrote:
>
> Pollywog wrote:
>
> > I am getting this MAGIC COOKIE error when I try to run some X stuff as root.
> > Is there something I can add to my profile in order to avoid it?
> >
> > Xlib: connection to ":0.0" refused by server
> > Xlib: Invalid MIT-MAGIC-COOKIE-1 key
> > ktail: cannot connect to X server :0.0
> >
> > thanks
> >
> > --
> > Andrew
> >
> > --
> > Unsubscribe? mail -s unsubscribe debian-user-request@lists.debian.org <
> > /dev/nullman
>
> man xhost
>
> --
> Unsubscribe? mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
Reply to: