in reply to Re^2: How to open nested SSH connection using perl
in thread How to open nested SSH connection using perl

And so, port forwarding is enabled in the gateway server...
use Net::OpenSSH; my $sshA = Net::OpenSSH->new($serverA, user => $userA, password => $passwordA); my $proxy_command = $sshA->make_remote_command({tunnel => 1}, $serverB +, 22); my $sshB = Net::OpenSSH->new($serverB, user => $userB, password => $passwordB, proxy_command => $proxy_command); $sshB->system($cmd1); $sshB->system($cmd2); ...

Replies are listed 'Best First'.
Re^4: How to open nested SSH connection using perl
by Anonymous Monk on Jul 13, 2015 at 11:34 UTC
      That means your version of the SSH client is too old and doesn't support the -W feature.

      Your current solution is not very elegant because others may be able to use the tunnels you are creating to get to serverB without login into serverA first.

Re^4: How to open nested SSH connection using perl
by gjoshi (Sexton) on Jul 14, 2015 at 03:58 UTC
    I am getting an error with this code -w option is not known option then we try to do

    my $sshB = Net::OpenSSH->new($serverB, user => $userB, password => $passwordB, proxy_command => $proxy_command);

      is socat or netcat or some similar program installed on serverA?