Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone know how to ssh to a cisco device(ssh enabled) and excute commands using net::ssh::perl????

2006-04-22 Retitled by Corion, as per Monastery guidelines
Original title: 'net::ssh::perl'

  • Comment on how to ssh to a cisco device using Net::SSH::Perl

Replies are listed 'Best First'.
Re: how to ssh to a cisco device using Net::SSH::Perl
by Marza (Vicar) on Jul 17, 2002 at 21:18 UTC

    It "shouldn't" be that difficult. What problems are you having?

    Post some source so we can see

      I can connect to the router but then an interactive session starts. I'm trying to use a register handle but the subroutine is ignored;
      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