in reply to Re: how to ssh to a cisco device using Net::SSH::Perl
in thread how to ssh to a cisco device using Net::SSH::Perl
my $ssh = Net::SSH::Perl->new( $host, cipher => 'DES3', debug => 2, ); $connection = $ssh -> login ("bakerj",$password); #$command = $ssh->cmd("enable"); $ssh->register_handler (SSH_SMSG_STDERR_DATA, sub { my($ssh, $packet) = @_; my $str = $packet->get_str; $packet = $ssh->packet_start(SSH_CMSG_STDIN_DATA); $packet->put_str("enable"); $packet->send; });
Edit by dws for <code> tags
|
|---|