I am using GRID::Machine instead of Net::SSH2. You have to set automatic autentification before using GRID::Machine.use strict; use GRID::Machine; my $host = shift || 'ddd@204.230.74.17'; my $machine = GRID::Machine->new(host => $host, uses => [ 'Net::Telnet +' ]); my $r = $machine->eval(q{ my $telnet = Net::Telnet-> new(); gprint "telnet ok" if $telnet-> open(Host=> '127.0.0.1', Port=> '22') +; $telnet-> login(Name=> 'ddd', Password=> 'pass'); my $a= $telnet-> get(); $a; }); print $r->result; # prints the contents of $a above
Hope it helps
Casiano
In reply to Re: Net::SSH2 and Net::Telnet
by casiano
in thread Net::SSH2 and Net::Telnet
by bgi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |