The debug message is the same output:
# queueing msg len: 5, code:1, id:3 ... [1] 00 00 00 05 01 00 00 00 03 # waiting for message... [1] connection failed: bad remote message received

That probably means Net::SFTP::Foreign thinks the authentication is over but it is not! Are you using the correct password?

Support for password authentication in Net::SFTP::Foreign has some limitations (for instace, it can't detect a bad password) because the ssh client used behind the scenes was not designed to be automated in that way.

In any case, upgrading to the latest version will probably make your problem disappear or alternatively, if you can, switch to public key authentication.

If everything else fails, install version 1.52_03 of the module that I have just uploaded to CPAN, rerun your script setting Net::SFTP::Foreign::debug = -1, and post the full debugging output.


In reply to Re^4: Can't connect using Password with Net::SFTP::Foreign by salva
in thread Can't connect using Password with Net::SFTP::Foreign by coglesby

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.