Hi everyone, i'm currently trying to write an ftp'ing program in perl and am having real trouble using the stfp modules to make an sftp connection using password authentication. I've read through the various threads here at the monastery, but none seem to hit the mark. Thus i post the question.

So, i have played around with using the following:

  • Net::SFTP::Foreign (yes i know it's being depricated)
  • Net::SFTP::Foreign::Compat
  • Net::SFTP

    I can make a connection with all of them, but with the first two i get the following in my log:

    debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,gssapi-keyex,gssa +pi-with-mic,password debug1: Next authentication method: password debug1: read_passphrase: can't open /dev/tty: No such device or addres +s debug1: Authentications that can continue: publickey,gssapi-keyex,gssa +pi-with-mic,password Permission denied, please try again. debug1: read_passphrase: can't open /dev/tty: No such device or addres +s debug1: Authentications that can continue: publickey,gssapi-keyex,gssa +pi-with-mic,password Permission denied, please try again. debug1: read_passphrase: can't open /dev/tty: No such device or addres +s debug1: Authentications that can continue: publickey,gssapi-keyex,gssa +pi-with-mic,password debug1: No more authentication methods to try. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). reading from ssh pipe failed ()

    Running Net::SFTP seems to work, but i would much rather make use of the installed SSH2 system modules, rather than the Perl implementation of the same.

    From my relatively poor understanding of how this all works, i understand that the login process is trying to write a response back to the calling process, and as it is essentially a batch process no tty device is available i get the error. However, from what i understand, installing IO::Pty should stop this problem - but it doesn't.

    I am running this on CentOS rel 5.5 with all the latest patches. Perl v5.8.8 and all the latest module versions are installed. Does anyone have any suggestions, because i am all out of ideas.


    In reply to SFTP login problems by chipchidster

    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.