So i've got a script using Net::SFTP::Foreign that is working on Cygwin and Solaris (with 1.53) but is not working on AIX (tried 1.53 and 1.54_01).
It does not seem to work properly when attempting to use password authentication. I've installed the latest Expect and IO::TTY.
The script is as below:
my $sftp = Net::SFTP::Foreign->new(host => 'myserver', user=> 'testuse +r', password => 'password'); $sftp->error() and die "Unable to connect to SFTP host - Error: " . $ +sftp->error();

Output (with 1.54_01) as follows:
Unable to connect to SFTP host - Error: Password interchange did not +complete: -1 at ./module_test.pl line 56.

I know the password to be correct as i can manually log into the sftp server with the same credentials.
Full output with more=>-v is as below:
OpenSSH_4.7p1, OpenSSL 0.9.8f 11 Oct 2007 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Failed dlopen: /usr/krb5/lib/libkrb5.a(libkrb5.a.so): Could no +t load module /usr/krb5/lib/libkrb5.a(libkrb5.a.so). System error: No such file or directory debug1: Error loading Kerberos, disabling Kerberos auth. debug1: Connecting to myserver [w.x.y.z] port 22. debug1: Connection established. debug1: identity file /home/myuser/.ssh/identity type -1 debug1: identity file /home/myuser/.ssh/id_rsa type -1 debug1: identity file /home/myuser/.ssh/id_dsa type -1 debug1: Remote protocol version 2.0, remote software version WeOnlyDo +2.1.0 debug1: no match: WeOnlyDo 2.1.0 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_4.7 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-cbc hmac-md5 none debug1: kex: client->server aes128-cbc hmac-md5 none debug1: sending SSH2_MSG_KEXDH_INIT debug1: expecting SSH2_MSG_KEXDH_REPLY debug1: Host 'myserver' is known and matches the RSA host key. debug1: Found key in /home/myuser/.ssh/known_hosts:5 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: password,publickey debug1: Next authentication method: publickey debug1: Trying private key: /home/myuser/.ssh/identity debug1: Trying private key: /home/myuser/.ssh/id_rsa debug1: Trying private key: /home/myuser/.ssh/id_dsa debug1: Next authentication method: password debug1: Authentications that can continue: password,publickey debug1: No more authentication methods to try. Permission denied (password,publickey). Unable to connect to SFTP host - Error: Password interchange did not +complete: -1 at ./module_test.pl line 56.


I don't know if this points anyone in the right direction but the error i was seeing with 1.53 was different it was -
Unable to connect to SFTP host: myserver. Error: Password not requeste +d as expected: -1 at pn4_deploy_common.pl line 210. Permission denied (password,publickey).

Any help would be MUCH appreciated

In reply to Net::SFTP::Foreign not workign properly on AIX by madorb

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.