Hello All,
I am running into a problem using the Net::SSH::Perl module to ssh into switches (both Foundry and Cisco). It seems that login just isn't working right. Here is the debug information:

Reading configuration data /root/.ssh/config Reading configuration data /etc/ssh_config Allocated local port 1023. Connecting to switch.generic.com, port 22. Remote protocol version 1.5, remote software version 1.2.27 Net::SSH::Perl Version 1.23, protocol version 1.5. No compat match: 1.2.27. Connection established. Waiting for server public key. Received server public key (768 bits) and host key (1024 bits). Host 'switch.generic.com' is known and matches the host key. Encryption type: IDEA Sent encrypted session key. Received encryption confirmation. Remote: Server does not permit empty password login. RSA authentication failed: Can't load public key. Trying password authentication. Sending command: blah Entering interactive session. Received disconnect message: Illegel commands

Here is the code:

my %params = ( protocol => 1, debug => "true", interactive => "true" ) +; $ssh = Net::SSH::Perl->new($serverName, %params); $ssh->login($user, $pass); $ssh->cmd("blah");

The error "Illegel commands" just sounds plain wierd. I have checked and know that I can login to the switch from the same machine this code runs on with the user and password specified in the program. Any help anyone can give me would be appriciated.


In reply to Net::SSH::Perl with switches by Domino

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.