I am trying to redirect my display from a debian box that I ssh into to my laptop. I connect using

Code:

$ssh -vv -XC remote.host

and in the debug messages all I get about X is this

Code:

debug1: Requesting X11 forwarding with authentication spoofing.

Once I'm connected, X forwarding does not work. For example, when I try and start, say, xcalc, I get

Code:

$xcalc &
Error: Can't open display:

It seems that the problem is the $DISPLAY variable is not set on the remote machine (echo $DISPLAY doesn't return anything), but from what I read, sshd is responsible for setting this variable, as long as "X11Forwarding yes" is uncommented in the /etc/ssh/sshd_config file (which I made sure is true).

Is there any other reason why sshd won't open a display on the remote host?

pingu

05-07-2011 02:58 PM

Try with "Y" instead of "X" - $ssh -vv -YC remote.host

vlsd

05-07-2011 06:51 PM

Quote:

Originally Posted by pingu
(Post 4349415)

Try with "Y" instead of "X" - $ssh -vv -YC remote.host

Already did. It makes no difference.

CodeKrash

05-07-2011 07:33 PM

Time to break out a tutorial and re create a headless O/S for use the way you want. I found that a properly configured box this way, is clever and valuable.

vlsd

05-07-2011 08:39 PM

I had missed what might be a key debug message when trying to connect. Here it is:

Apparently, disabling ipv6 in any way messes with X forwarding in ssh, it turns out it's an openssh issue. The posts suggest two workarounds:
1. add '-4' to the options passed to sshd in /etc/default/ssh
2. add 'AddressFamily inet' in /etc/ssh/sshd_config

Apparently, disabling ipv6 in any way messes with X forwarding in ssh, it turns out it's an openssh issue. The posts suggest two workarounds:
1. add '-4' to the options passed to sshd in /etc/default/ssh
2. add 'AddressFamily inet' in /etc/ssh/sshd_config