Of course! How foolish of me... all we needed was debugging enabled ;-)

You're remote SSH server is *probably* not accepting cleartext password tunneling. In other words, its /etc/ssh/sshd_config is saying something like:

PasswordAuthentication no
And that's what's causing (my) error when trying to use a username and password for authentication. When I changed it to yes, and restarted the remote SSH server, the scripts works, because debugging now said:
wolf: Sending request for user-authentication service.
wolf: Service accepted: ssh-userauth.
wolf: Trying empty user-authentication request.
wolf: Authentication methods that can continue: publickey,password,keyboard-interactive.
Where it used to be (with PasswordAuthentication no):
wolf: Sending request for user-authentication service.
wolf: Service accepted: ssh-userauth.
wolf: Trying empty user-authentication request.
wolf: Authentication methods that can continue: publickey,keyboard-interactive.
So the above debugging says that the remote SSH server only accepts ssh keys or a keyboard interactive password..

My advise is: create an ssh-key for the user that runs your script, and add the public key of that user to the authorized_keys file of your remote user. This is more secure than enabling clear text password tunneling ;-)

HTH

to ask a question is a moment of shame
to remain ignorant is a lifelong shame


In reply to Re^7: sftp->do_write howto? by insaniac
in thread sftp->do_write howto? by chrism01

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.