Re: ssh X tunneling through more than one server



[...]

This is what I use:

Let's call your box M1. You can access unix1 from M1 via SSH, and
unix1 can access unix2 via SSH. You would like to access unix2 directly
from M1 via SSH. In M1 you would do the following:

ssh -fngT -L 3022:unix2:22 -C unix1 ping -i 30 localhost > /dev/
null 2>&1

With this running, the command

ssh -p 3022 localhost

issued on M1 should give you a shell on unix2.

I get the following error message:

ssh_exchange_identification: Connection closed by remote host

[...]

I'm not sure if unix1 can access unix2 via SSH because if I do

ssh unix2

within unix1, I'll get:

ssh: connect to host unix2 port 22: Connection refused

.