in reply to Re^4: Establishing SSH tunnel and opening another SSH connection through it
in thread Establishing SSH tunnel and opening another SSH connection through it
The solution is just to not ask for password authentication in the gateway:
my $ssh_gw = Net::OpenSSH->new($gw); # no password given, authenticate # using public key on the gateway my $proxy_command = $ssh_gw->make_remote_command('nc %h %p'); my $ssh = Net::OpenSSH->new($host, password => $password, # request password +authentication master_opts => [-o => "ProxyCommand=$proxy +_command"]);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Establishing SSH tunnel and opening another SSH connection through it
by tehcook (Initiate) on Feb 09, 2012 at 19:47 UTC |