I get the same permission denied error, except line 62 instead of line 51 (perhaps different versions of Net::SFTP??), when username and/or password are incorrect.

On CentOS5 linux ssh logins are logged to /var/log/secure. On a failed login attempt with an invalid user I get entries like the following:

Jul 23 12:44:53 alula sshd[4911]: Invalid user frog from 127.0.0.1 Jul 23 12:44:53 alula sshd[4912]: input_userauth_request: invalid user + frog Jul 23 12:44:53 alula sshd[4911]: pam_unix(sshd:auth): check pass; use +r unknown Jul 23 12:44:53 alula sshd[4911]: pam_unix(sshd:auth): authentication +failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=alula.home.local Jul 23 12:44:53 alula sshd[4911]: pam_succeed_if(sshd:auth): error ret +rieving information about user frog Jul 23 12:44:55 alula sshd[4911]: Failed password for invalid user fro +g from 127.0.0.1 port 34572 ssh2 Jul 23 12:44:55 alula sshd[4911]: pam_unix(sshd:auth): check pass; use +r unknown Jul 23 12:44:55 alula sshd[4911]: pam_succeed_if(sshd:auth): error ret +rieving information about user frog Jul 23 12:44:57 alula sshd[4911]: Failed password for invalid user fro +g from 127.0.0.1 port 34572 ssh2 Jul 23 12:44:57 alula sshd[4911]: pam_unix(sshd:auth): check pass; use +r unknown Jul 23 12:44:57 alula sshd[4911]: pam_succeed_if(sshd:auth): error ret +rieving information about user frog Jul 23 12:44:59 alula sshd[4911]: Failed password for invalid user fro +g from 127.0.0.1 port 34572 ssh2 Jul 23 12:44:59 alula sshd[4912]: Connection closed by 127.0.0.1 Jul 23 12:44:59 alula sshd[4911]: PAM 2 more authentication failures; +logname= uid=0 euid=0 tty=ssh ruser= rhost=alula.home.local

I had specified the non-existent user name 'frog' to Net::SFTP.

I suggest you review the logs on your ssh server to determine whether the user authentication is succeeding and the cause of any authentication failure.

update: Don't know what made me think the error message cc received was indicating line 51.


In reply to Re: transfer a file via SFTP by ig
in thread transfer a file via SFTP by cc

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.