Question

I connect to two different SSH servers A and B using PuTTY+Xming from Windows.

On server A, echo $DISPLAY yields localhost:10.0 (already set somehow); while on server B, I've manually set the DISPLAY variable to be localhost:10.0 as well.

However, I am able to use xclock on server A, but not on server B. The only way I could get it to work on server B is by adding server B's IP address to Xming's X0.hosts configuration AND setting the DISPLAY environment variable to my Windows machine's IP address.

My question is, how come server A's xclock works with minimal setup (just enable X11 forwarding and set display location to localhost:0.0 in PuTTY), but not server B's?

In addition, how can one look for the script that set the DISPLAY environment variable to localhost:10.0 on server A?


Additional info: 1) Server A has an ~/.Xauthority file that gets automatically created upon login, while server B does not. 2) Server B's /var/log/auth.log contained the following error: sshd[1404]: error: Failed to allocate internet-domain X11 display socket. 3) I changed the hostname of Server B once before.

Was it helpful?

Solution

After much googling, it turns out the culprit is disabled ipv6 on server B.

As a workaround, the following line needs to be added to /etc/ssh/sshd_config:

AddressFamily inet

Should now work after sudo service ssh reload.

I found the solution here and here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top