bgi has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use Net::SSH2; use Net::Telnet; my $ssh1= Net::SSH2-> new(); if($ssh1-> connect('204.230.74.17', '22')){print "connect1 ok \n";} # +or die "conncet to SSH1 failed"; if($ssh1-> auth_password('ddd', 'pass')){print "auth1 ok \n";} # or di +e "auth1 failed"; if($ssh1-> tcpip('134.46.156.237:22', '127.0.0.1:22')){print "tunnel o +k \n";} my $ssh2= Net::SSH2-> new(); if($ssh2-> connect('127.0.0.1', '22')){print "connect2 ok \n";}# or di +e "conncet to SSH2 failed"; if($ssh2-> auth_password('ddd','pass')){print "auth2 ok \n";}# or die +"auth2 failed"; my $chan1= $ssh2-> channel(); my $telnet = Net::Telnet-> new (); if($telnet-> open(Host=> '127.0.0.1', Port=> '22')){print "telnet ok"; +}#; $telnet-> login(Name=> 'ddd', Password=> 'pass'); $a= $telnet-> get();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SSH2 and Net::Telnet
by casiano (Pilgrim) on Jun 03, 2008 at 09:12 UTC | |
|
Re: Net::SSH2 and Net::Telnet
by bgi (Sexton) on Jun 18, 2008 at 10:59 UTC |