Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^5: Establishing SSH tunnel and opening another SSH connection through it

by salva (Canon)
on Feb 09, 2012 at 08:37 UTC ( [id://952672]=note: print w/replies, xml ) Need Help??


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

That happens because requesting password authentication disables the authentication agent.

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"]);
  • Comment on Re^5: Establishing SSH tunnel and opening another SSH connection through it
  • Download Code

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
    That was it ! I was pretty sure that ProxyCommand goes by itself, is non-interactive and uses only public key. And whatever is requested in OpenSSH->new() applies to the destination host. Thank you for help

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://952672]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found