in reply to Re^2: Establishing SSH tunnel and opening another SSH connection through it
in thread Establishing SSH tunnel and opening another SSH connection through it

If you have tunnels enabled on the gateway, you can use Net::OpenSSH tunnel methods to create a connection to some remote machine accesible from the gateway without the need to create a local listener.

For instance:

my $ssh_g = Net::OpenSSH->new($gateway); my $proxy_command = $ssh_g->make_remote_command({tunnel => 1}, $host, +22); my $ssh = Net::OpenSSH->new($host, master_opts => [-o => "ProxyCommand +=$proxy_command"]);
  • Comment on Re^3: Establishing SSH tunnel and opening another SSH connection through it
  • Download Code