-   Linux - Desktop (
-   -   X11 authentication issues (

wirawan0 10-24-2012 04:53 PM

X11 authentication issues
I've been puzzled lately with X11 way of authentication an incoming connection. I use several computers exclusively and want to be able to display stuff on the X server of one of them.

Here's my latest failure:

*) on computer A, I have a screen session running with DISPLAY set to ":0.0" (of course)

*) on computer B, I connect to computer A with ssh:


user@B:~ $ ssh -Y A
*) In this shell session (on A), I will get, e.g., DISPLAY=localhost:11.0 .

*) this gets me from B to A. Now I reconnect to the screen on A using: `screen -x' command.

*) What I want now is, under this `screen' session, to run a program on "A", but display its output on "B", like this:


user@A:~ $ DISPLAY=:0.0 xpdf stuff.pdf
Sadly I get this error:


X11 connection rejected because of wrong authentication.
Cannot parse arguments: Cannot open display:
I thought, since the ssh connection is mine, and the user under which the screen is running on "A" is also mine, why then can't I connect to my own X session under SSH?

I tried to import all the environment variables under the ssh terminal session (before I invoked "screen -x") but it won't help either.

What's going on here? Can somebody point me in the right direction?

FYI: I run Debian 6 on "A" and Mint LMDE 2012.4 on "B".


wirawan0 10-24-2012 05:02 PM

ARgh! I answered myself, again!
Here's the answer:

* copy the DISPLAY value from the ssh shell section, as before.
* in the screen session, unexport or unset XAUTHORITY (since we aren't connecting to A's X session) just before running the command (e.g. xpdf in the case above).

Then I successfully connect to B's X session.

Still, I want to get an explanation on how X connection authentication is made. Nowadays it is a complicated matter, with XAUTHORITY stuff and many more.

All times are GMT -5. The time now is 01:40 AM.