Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: Can't connect using Password with Net::SFTP::Foreign

by salva (Canon)
on May 04, 2009 at 15:26 UTC ( [id://761746]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Can't connect using Password with Net::SFTP::Foreign
in thread Can't connect using Password with Net::SFTP::Foreign

The debug message is the same output:
# queueing msg len: 5, code:1, id:3 ... [1] 00 00 00 05 01 00 00 00 03 # waiting for message... [1] connection failed: bad remote message received

That probably means Net::SFTP::Foreign thinks the authentication is over but it is not! Are you using the correct password?

Support for password authentication in Net::SFTP::Foreign has some limitations (for instace, it can't detect a bad password) because the ssh client used behind the scenes was not designed to be automated in that way.

In any case, upgrading to the latest version will probably make your problem disappear or alternatively, if you can, switch to public key authentication.

If everything else fails, install version 1.52_03 of the module that I have just uploaded to CPAN, rerun your script setting Net::SFTP::Foreign::debug = -1, and post the full debugging output.

Replies are listed 'Best First'.
Re^5: Can't connect using Password with Net::SFTP::Foreign
by coglesby (Initiate) on May 04, 2009 at 15:32 UTC
    Thanks so much for your input. It is the correct password because I printed out the password in one of my tests as well as the password length to ensure there are no unseen characters there. Once they install the new version I will see where it goes. Thanks again!
      Well the admin upgraded our package to version 1.51 and I reran the script with debugging output set to -1 and received the following results:
      OpenSSH_3.9, OpenSSL 0.9.7d 17 Mar 2004 HP-UX Secure Shell-A.03.91.009, HP-UX Secure Shell version debug1: Reading configuration data /opt/ssh/etc/ssh_config debug1: Connecting to 172.19.1.47 [172.19.1.47] port 22. debug1: Connection established. debug1: identity file /opt/informatica/powercenter/server/infa_shared/ +SrcFiles//.ssh/id_rsa type -1 debug1: identity file /opt/informatica/powercenter/server/infa_shared/ +SrcFiles//.ssh/id_dsa type -1 debug1: Remote protocol version 2.0, remote software version 1.36_sshl +ib GlobalSCAPE debug1: no match: 1.36_sshlib GlobalSCAPE debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_3.9 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client 3des-cbc hmac-md5 none debug1: kex: client->server 3des-cbc hmac-md5 none debug1: sending SSH2_MSG_KEXDH_INIT debug1: expecting SSH2_MSG_KEXDH_REPLY #9516 queueing msg len: 5, code:1, id:3 ... [1] 00 00 00 05 01 00 00 00 03 + | ......... #9516 waiting for message... [1] #9516 _do_io connected: 1 #9516 _do_io select(-,-,-, undef) #9516 _do_io write queue: 9, syswrite: 9, max: 20480 #9516 _do_io select(-,-,-, undef)
      It also seems to hang at this point on a blank command line.
        Whoa! you are trying to connect to a GlobalSCAPE server from an HP-UX host and using a very old OpenSSH package... It is not going to be easy!
        debug1: sending SSH2_MSG_KEXDH_INIT debug1: expecting SSH2_MSG_KEXDH_REPLY
        This couple of lines tells us that the SSH handshaking stalls so, to be really sure that this is the problem, the first think you should do is try to connect to the remote server using the ssh client from the command line:
        $ ssh -vvv 172.19.1.47 echo hello
        and if it doesn't work my advice would be to upgrade the version of OpenSSH on the client machine.

        update: in the past, several users have reported their success using Net::SFTP::Foreign to connect to a GlobalSCAPE server.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://761746]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 01:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found