My ssh_config contains the lines: Host * ForwardAgent yes ForwardX11 yes on both computers to be connected. The sshd_config has the line: X11Forwarding yes included. My DISPLAY variable is set, that is > echo $DISPLAY yields: :0.0 Connecting to the other machine via ssh $USER@machine works fine, debug output contains: debug1: Requesting X11 forwarding with authentication spoofing. debug1: channel 0: request x11-req debug1: channel 0: request shell debug1: channel 0: open confirm rwindow 0 rmax 32768 Starting any X-application fails, dumping the message: _X11TransSocketOpen: socket() failed for tcp _X11TransSocketOpenCOTSClient: Unable to open socket for tcp _X11TransOpen: transport open failed for tcp/localhost:10 ... Xt error: Can't open display: localhost:10.0 Following the application start with strace gives some more information: socket(PF_INET6, SOCK_STREAM, 0) = -1 EAFNOSUPPORT (Address family not supported by protocol) write(2, "_X11Trans", 9_X11Trans) = 9 write(2, "SocketOpen: socket() failed for "..., 36SocketOpen: socket() failed for tcp ) = 36 write(2, "_X11Trans", 9_X11Trans) = 9 write(2, "SocketOpenCOTSClient: Unable to "..., 52SocketOpenCOTSClient: Unable to open socket for tcp ) = 52 write(2, "_X11Trans", 9_X11Trans) = 9 write(2, "Open: transport open failed for "..., 49Open: transport open failed for tcp/localhost:10 I have no idea, why INET6 is used. These lines also appear when I use ssh -4 $USER@machine. It's to no avail.
after you ssh, what does echo $DISPLAY give you?
It says: localhost:10.0 while being logged in on the remote machine.
Before stealing anyones precious time, I'd just like to make sure I've got my machine set up properly. I've just discovered that my ~/.xsession-errors file gives me the following warning: startkde: Starting up... kbuildsycoca running... mcop warning: user defined signal handler found for SIG_PIPE, overriding Can't get own host name. Your system is severely misconfigured This is funny, since 'hostname -f' or 'hostname' returns the correct (fqdn, host's name) answer. I don't know whom to trust. All other networking stuff (except X11Forward) works just fine.
make sure that your hosts file has your hostname in it, and that you have at least bind-tools installed (if not bind itself)
Ok, right now I've two machines here: juliette and shc. juliette is acting as a firewall, it has eth0 connected to the internet (dynamic ip), and eth1 serves the local net. Works fairly nice. The machine shc (a laptop, fixed ip) may connect to juliette from the local net (at home, eth1), or from the internet (eth0) using ssh. ------------------------------------------- On juliette (the firewall): 'emerge -s bind-tools' says: net-dns/bind-tools Latest version available: 9.2.2 Latest version installed: 9.2.2 Size of downloaded files: 4,951 kB Homepage: http://www.isc.org/products/BIND/bind9-beta.html Description: bind tools: dig, nslookup, and host and /etc/hosts says: 192.168.0.153 shc 127.0.0.1 localhost -------------------------------------------- On shc (the laptop): bind-tools same as above, /etc/hosts: 127.0.01 shc localhost 192.168.0.153 shc -------------------------------------------- The X11Forward problem must exist on both machines alike, since I've used other Linux machines at work to dial in to either juliette or shc. While logging in works fine, X11Forwarding does not. All Linux machines at work do not show this behaviour, i.e. X11Forwarding works perfectly among them. On those machines, ssh -V yields: OpenSSH_3.4p1 Debian 1:3.4p1-1, SSH protocols 1.5/2.0, OpenSSL 0x0090603f When connecting from a Linux machine at work with the above ssh version to juliette at home, I also get: _X11TransSocketOpen: socket() failed for tcp _X11TransSocketOpenCOTSClient: Unable to open socket for tcp _X11TransOpen: transport open failed for tcp/localhost:11 xterm Xt error: Can't open display: localhost:11.0 when starting xterm for example.
On a side note, downgrading to Version 3.5p1 does not solve the problem. So it's most likely me being too stupid to setup my boxes properly. If no one else experiences the same X11Forwarding issue, this bug report might as well be closed.
I'm still trying to track the darn problem down. Enabling the sshd's DEBUG output gives the prints the following message to the log files: debug1: session_input_channel_req: session 0 req x11-req debug1: x11_create_display_inet: Socket family 10 not supported Anyone else seen this before?
I've actually got X11 forwarding to work through putty when I'm at work with this version and the previous versions as well. My settings are pretty much like yours except the remote side, I listen on localhost:0 and I have Excursion to handle the windows. Might want to check your settings or gentoo forums on this matter. If the program you happen to use is also putty, you must exclude these host/ips localhost,127.0.0.1 because of a bug that has yet to be fixed. Find me on freenode at sj7trunks, lets see if we can get this fixed.
I've changed my settings to also use localhost:0 and even tried putty. Still X11-Forwarding does not work. The error message has changed, though (trying to open a simple xterm): xterm Xt error: Can't open display $myhostname:0.0 Looks slightly better, but does it help?
I have FINALLY solved the mystery! OpenSSH is definitely NOT the source of the problem. Two hints lead the way out: 1. strace always said: socket(PF_INET6, SOCK_STREAM, 0) = -1 EAFNOSUPPORT (Address family not supported by protocol) 2. netstat -l -n | grep 6000 always gave empty output, so the X11 server was not listening as expected SOLUTION: If the kernel is configured to optionally support the IPv6 protocol via kernel module, this module (ipv6.o) MUST be loaded before starting the X11 server. Otherwise, X11 is seemingly unable to properly resolve hostnames and setup its sockets correctly. This bug report is therefore invalid and may be closed. Sorry for the inconvenience I might have caused.
Closed bug per user request