Wednesday, July 01, 2009

ssh -X Error: Can't open display:

The error occurred when I was accessing a server (Arch linux) from a desktop (Mac X) using ssh -X username@serverip. In other words I wanted to X forward some apps from server to my desktop. First thing to do, I checked whether $DISPLAY variable on the server was setecho $DISPLAYIt was not. Then I checked the setting of my ssh daemon (sshd) on the server in /etc/ssh/sshd_config. I found that option X11Forwarding was not set, so I set it toX11Forwarding yes and I restarted the sshd. After this I logged in to the server again using ssh -X and this time echo $DISPLAY
localhost:11.0
Now X forwarding was working! It appears that $DISPLAY does not have to point to my desktop.