# X11 tunnels in ssh appear to be broken

## gmtl3

I'm trying to ssh to a server and run a remote X11 connection back to my local client through the ssh tunnel.  forward X11 is turned on in the sshd_config file, the DISPLAY variable is set, and the remote server is listening on localhost:6010, so it seems to be set up correctly.  However, when I try to do something like run xterm, I get the following error messages:

_X11TransSocketOpen: socket() failed for tcp

_X11TransSocketOpenCOTSClient: Unable to open socket for tcp

_X11TransOpen: transport open failed for tcp/localhost:10

xterm Xt error: Can't open display: localhost:10.0

I made sure "X" was in my "USE" variable, and I"ve re-emerged xfree and openssh, with no changes.  Any Ideas?

----------

## Anior

You are using "shh -X" right?

----------

## gmtl3

Yes.  I also have:

Host *

      ForwardX11 yes

... in my $HOME/.ssh/config file

----------

## fleed

Just a thought, dunno if it makes sense: does the X server you're forwarding to support tcp connections? I'm not sure if ssh fwding uses tcp or sockets but you could look at that.

----------

## vdboor

 *gmtl3 wrote:*   

> Yes.  I also have:
> 
> Host *
> 
>       ForwardX11 yes
> ...

 

You'd better disable this. every time you ssh to a machine, you expose your entire display to keyloggers, and other nasty stuff.

rather use the -X option when you really need it.

Does the other host have "X11Forwarding yes" enabled?

----------

## Robelix

For me it works only when I add

```

expr "$DISPLAY" : "localhost:" >/dev/null && DISPLAY="inet/$DISPLAY"

```

to the .bash_profile on the remote machine.

----------

## gmtl3

Wow, adding the "inet/" to the front of the $DISPLAY variable fixed it.  I've never had to do that before.

----------

## jeffbuttars

Adding that line to my .bash_profile worked for me as well. But then I tred recompiling kernel adding ipv6 support( as a module ), after a reboot to the kernel with ipv6 support in it X11 forwarding worked like a charm without the DISPLAY line in my .bash_profile.

I'm using kernel 2.6.1

----------

## gRoTTo.oRc

Yup, for me this problem was definately IPv6. Two of my boxes had IPv6 compiled as modules, but only one was actually loading the ipv6 module. Loading the module on the second in /etc/modules.autoload.d/kernel-2.4 solved the "unable to open socket for tcp" problem in both X and mc.

----------

