Hi All
I need SSH to a host which I have no direct connectivity with. It's only available through another host (SSH gateway). I've been trying different modules from CPAN - Net::SSH2, Net::OpenSSH to :
1) establish ssh connection to host1 (ssh gateway)
2) setup tunnel to the destination host
3) use ssh tunnel to open ssh connection to the destination host
I was not able to figure out how to do this. Net::SSH2 supposedly can open new ssh connection given a handle. It fails to do so if I give it handle returned by it's tcpip() function though. Net::OpenSSH only operates against $host or so it seems... Was anyone able to do something similar to this ?
The only way I see it to connect to the first host, then run ssh command in the remote shell. Unfortunately doing it this way will stop ssh-agent auth working and I will have to resort to passwords.
thanks a lot for your helpful tips