in reply to openssh start another ssh session on machine b
You can use the ProxyCommand feature of OpenSSH (requires tunnels enabled on host b and a relatively recent version of OpenSSH on the local host):
Another option is to install Net::OpenSSH::Gateway available from GitHub.my $ssh_b = Net::OpenSSH->new($host_b, ...); $ssh_b->error and die; my $tunnel_cmd = $ssh_b->make_remote_command({tunnel => 1}, $host_c, 2 +2); my $ssh_c = Net::OpenSSH->new($host_c, master_opts => [-o => "ProxyCom +mand=$tunnel_cmd"], ...); $ssh_c->error and die; $ssh_c->system('ls');
That module implements a set of strategies to forward SSH connections over different kinds of proxies including SSH gateways. It is not on CPAN because I was not happy with its internal architecture and planed to revamp it completely but unfortunately, I never got the time (or the guts) to actually do it and it has languished there. In any case I would fix any bug reported.my $ssh_c = Net::OpenSSH->new($host_c, gateway => { proxy => "ssh://$h +ost_b"}, ...);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: openssh start another ssh session on machine b
by jhuijsing (Acolyte) on Mar 31, 2014 at 03:53 UTC | |
by salva (Canon) on Mar 31, 2014 at 07:26 UTC |
In Section
Seekers of Perl Wisdom