be warned! Cisco products vary greatly.

good luck! (plain ssh + Expect is your best bet. wink wink nudge nudge)

use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new( 'rtr', protocol => '2', debug => 1, interactive => 0, ); $ssh->login( 'admin', 'password' ) or die "login\n"; $ssh->shell; __END__ version 1 -> PIX Firewall Services Module localhost: Reading configuration data /home/username/.ssh/config localhost: Reading configuration data /etc/ssh_config localhost: Connecting to thertr-fw, port 22. localhost: Remote protocol version 1.5, remote software version Cisco- +1.25 localhost: Net::SSH::Perl Version 1.25, protocol version 1.5. localhost: No compat match: Cisco-1.25. localhost: Connection established. localhost: Waiting for server public key. localhost: Received server public key (768 bits) and host key (1024 bi +ts). localhost: Host 'thepix' is known and matches the host key. localhost: Encryption type: DES3 localhost: Sent encrypted session key. localhost: Received encryption confirmation. localhost: Trying password authentication. localhost: Requesting pty. localhost: Requesting shell. localhost: Entering interactive session. Type help or '?' for a list of available commands. thepix-FW> thepix-FW> exit version 2 -> Cisco IOS localhost: Reading configuration data /home/username/.ssh/config localhost: Reading configuration data /etc/ssh_config localhost: Connecting to thertr, port 22. localhost: Remote protocol version 2.0, remote software version Cisco- +1.25 localhost: Net::SSH::Perl Version 1.25, protocol version 2.0. localhost: No compat match: Cisco-1.25. localhost: Connection established. localhost: Sent key-exchange init (KEXINIT), wait response. localhost: Algorithms, c->s: 3des-cbc hmac-sha1 none localhost: Algorithms, s->c: 3des-cbc hmac-sha1 none localhost: Entering Diffie-Hellman Group 1 key exchange. localhost: Sent DH public key, waiting for reply. localhost: Received host key, type 'ssh-rsa'. localhost: Host 'thertr' is known and matches the host key. localhost: Computing shared secret key. localhost: Verifying server signature. localhost: Waiting for NEWKEYS message. localhost: Enabling incoming encryption/MAC/compression. localhost: Send NEWKEYS, enable outgoing encryption/MAC/compression. localhost: Sending request for user-authentication service. localhost: Service accepted: ssh-userauth. localhost: Trying empty user-authentication request. localhost: Authentication methods that can continue: password. localhost: Next method to try is password. localhost: Trying password authentication. localhost: Login completed, opening dummy shell channel. localhost: channel 0: new [client-session] localhost: Requesting channel_open for channel 0. localhost: channel 0: open confirm rwindow 1024 rmax 4096 localhost: Got channel open confirmation, requesting shell. localhost: Requesting service shell on channel 0. localhost: channel 1: new [client-session] localhost: Requesting channel_open for channel 1. localhost: Entering interactive session. localhost: Channel open failure: 1: reason 4:

In reply to Re: Problem in enabling authentication after logging in to a firewall by Anonymous Monk
in thread Problem in enabling authentication after logging in to a firewall by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.