in reply to Establishing SSH tunnel and opening another SSH connection through it
Was anyone able to do something similar to this ?Yes, but not by using Net::*. (That doesn't mean it's not possible with Net::*, I just never tried). I just set up a tunnel. Here's a (cleaned) section of my ssh config file. It actually creates tunnels through *2* intermediate hosts:
You may have to tweak it before it works for you.Host = * ControlMaster = auto ControlPath = /home/javafan/.ssh/ssh_%h_%p_%r Host = gateway1 HostName = gateway1.example.com User = javafan ForwardAgent = yes ServerAliveInterval = 60 Host = gateway2 Hostname = gateway2.example.com User = javafan ForwardAgent = yes ProxyCommand = ssh gateway1 nc %h %p Host = *.example.com ForwardAgent = yes User = javafan ProxyCommand = ssh gateway2 nc %h %p
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 tipsNah. At work, I often have to "hop" from machine to machine to get to the target machine, and as long as you use ssh -A, or have the appropriate ForwardAgent = yes entries in your ssh config files, ssh-agent authentication just works.
But this is way outside the realm of Perl.
|
|---|