SSH tunnel and X forwarding

Hi all,

I'm having a problem setting up an SSH connection with X Forwarding in a very special setup, and hope you will be able to help me.

The setup is as follows: I live in a student residence and have a computer there named ririu. This computer isn't reachable from the outside, as the university's computer center blocks all ingoing connections to the residence from the outside.
The only reachable computer from the outside is our server in the residence, hal, for which the computer center makes an exception.

I'm now at my parent's place and want to build up an SSH connection with X Forwarding from my computer here, freya, to ririu, my computer in the residence. As hal is in the same LAN as ririu, obviously I can connect from freya to hal, and then from hal to ririu.

So I can also log in to hal and do a

malte@hal $ ssh -g -L 2508:ririu:22 malte@ririu

to build up an SSH tunnel. Then I can connect from freya to ririu using

malte@freya $ ssh -p 2508 malte@hal

This works like a charm. However, now I also want to have X Forwarding ;)

So I tried to specify -X as an additional parameter.

malte@freya $ ssh -p 2508 -X malte@hal

I do succeed in connecting to ririu. Except that the X forwarding doesn't work!

malte@ririu $ firefox
Error: no display specified
malte@ririu $ echo $DISPLAY

malte@ririu $

An X Forwarding to hal works flawlessly:

malte@freya:~$ ssh -X malte@hal
malte@hal $ echo $DISPLAY

...I can start X applications on hal and they are displayed on freya. But as you see, when I try to this from freya through an SSH tunnel from hal to ririu, the DISPLAY variable somehow gets lost. It doesn't help to randomly set the DISPLAY variable on ririu to localhost:11.0 or localhost:10.0 either, which I tried in desperation.

I hope I made it clear what the problem is, otherwise just ask :)
Do you have any idea why this isn't working? I would have assumed that ssh doesn't even notice it's running through an SSH tunnel and that this should hence work without problems. But it doesn't... so, is there any way for me to build up an ssh connection with X forwarding from freya to ririu at all?

Thanks for your help :)

Relevant Pages

  • Re: Load estimation - SSH on HP-UX
    ... > perform port forwarding only. ... Run one SSH session per forwarded connection. ... One a single SSH session with a large number of forwarded connections. ... B1) There's a sanity-check limit of the number of port forwards of 100 ...
  • port forwarding source address
    ... The SSH encrypted connection itself can be bound to a specific IP address ... Port forwarding can bind to a specific address on the listening host, ...
  • Port Forwarding over Unreliable Connections
    ... I make extensive use of ssh port forwarding to access machines behind ... patiently wait a long time before finally snipping the connection. ...
  • Tunneling SMTP Traffic Via SSH Question
    ... forward port 25 over SSH via Putty to an off-campus mail server. ... Tunnels> Forwarded ports: ... When I try testing the connection in Outlook it returns an error saying ... I could get around that via SSH forwarding. ...
  • Re: What is The SSH?
    ... Building and Using SSH Tunnels ... What is an SSH tunnel? ... how to use it to make a connection to a server. ... You will need a working SSH client and server installation to build and test ...