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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |