jmontero101 has asked for the wisdom of the Perl Monks concerning the following question:

So i've got a script using Net::SFTP::Foreign that is working on HPUX (with 1.77) but is not working when trying to connect to an Alcatel system It does not seem to work properly when attempting to use password authentication. I've installed the latest IO::TTY. The script is as below:
$Net::SFTP::Foreign::debug = ~(8|16|1024|2048); $sftp = Net::SFTP::Foreign->new ('172.23.102.133', user => 'isadmin', timeout => 30, password => "ANS#150", more => ['-o', 'PreferredAuthentications=password,keyboard +-interactive,publickey', '-vvvv']) or die "No he podido establecer la conexion con +el equipo"; if ($sftp->error){ print "6565:No puedo conectar con el servidor sftp.\n\r"; PintaLog("6565:No puedo conectar con el servidor sftp"); exit 1; }
Output (with 1.77) as follows:
#3779 1415690486.00000 new: This is Net::SFTP::Foreign 1.77 #3779 1415690486.00000 new: Loaded from /opt/perl_64/lib/site_perl/5.8 +.8/Net/SFTP/Foreign.pm #3779 1415690486.00000 new: Running on Per for hpux #3779 1415690486.00000 new: debug set to 18446744073709548519 #3779 1415690486.00000 new: ~0 is 18446744073709551615 #3779 1415690486.00000 new: Using backend Net::SFTP::Foreign::Backend: +:Unix 1.76_03 #3779 1415690486.00000 _init_transport: ssh cmd: ssh -o NumberOfPasswo +rdPrompts=1 -l isadmin -o PreferredAuthentications=password,keyboard- +interactive,publickey -vvvv 172.23.102.133 -s sftp #3779 1415690486.00000 _init_transport: starting password authenticati +on #3779 1415690486.00000 _init_transport: checking timeout, max: 30, ell +apsed: 1.50203704833984e-05 #3779 1415690486.00000 _init_transport: waiting for data from the pty +to become available OpenSSH_5.6p1+sftpfilecontrol-v1.3-hpn13v7, OpenSSL 0.9.8o 01 Jun 2010 HP-UX Secure Shell-A.05.60.003, HP-UX Secure Shell version debug1: Reading configuration data /opt/ssh/etc/ssh_config debug3: RNG is ready, skipping seeding debug2: ssh_connect: needpriv 0 debug1: Connecting to 172.23.102.133 [172.23.102.133] port 22. debug1: Connection established. debug1: identity file /users/adminweb/.ssh/identity type -1 debug1: identity file /users/adminweb/.ssh/identity-cert type -1 debug3: Not a RSA1 key file /users/adminweb/.ssh/id_rsa. debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug2: key_type_from_name: unknown key type '-----END' debug3: key_read: missing keytype debug1: identity file /users/adminweb/.ssh/id_rsa type 1 debug1: identity file /users/adminweb/.ssh/id_rsa-cert type -1 debug1: identity file /users/adminweb/.ssh/id_dsa type -1 debug1: identity file /users/adminweb/.ssh/id_dsa-cert type -1 debug1: Remote protocol version 2.0, remote software version IPSSH-1.1 +2.0 debug1: no match: IPSSH-1.12.0 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.6p1+sftpfilecontrol-v1. +3-hpn13v7 debug2: fd 4 setting O_NONBLOCK debug3: RNG is ready, skipping seeding debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: AUTH STATE IS 0 debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie +-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellm +an-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v +01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh. +com,ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256 +,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,a +es256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256 +,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,a +es256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac +-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac +-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-dss debug2: kex_parse_kexinit: aes128-cbc,blowfish-cbc,3des-cbc,des-cbc debug2: kex_parse_kexinit: aes128-cbc,aes192-cbc,aes256-cbc,blowfish-c +bc,cast128-cbc,3des-cbc,des-cbc,des-cbc,arcfour debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96 debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96 debug2: kex_parse_kexinit: none debug2: kex_parse_kexinit: none debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-md5 debug1: REQUESTED ENC.NAME is 'aes128-cbc' debug1: kex: server->client aes128-cbc hmac-md5 none debug2: mac_setup: found hmac-sha1 debug1: REQUESTED ENC.NAME is 'aes128-cbc' debug1: kex: client->server aes128-cbc hmac-sha1 none debug2: dh_gen_key: priv key bits set: 165/320 debug2: bits set: 519/1024 debug1: sending SSH2_MSG_KEXDH_INIT debug1: expecting SSH2_MSG_KEXDH_REPLY #3779 1415690487.00000 _init_transport: checking timeout, max: 30, ell +apsed: 0.995189905166626 #3779 1415690487.00000 _init_transport: waiting for data from the pty +to become available debug3: check_host_in_hostfile: host 172.23.102.133 filename /users/ad +minweb/.ssh/known_hosts debug3: check_host_in_hostfile: host 172.23.102.133 filename /users/ad +minweb/.ssh/known_hosts debug3: check_host_in_hostfile: match line 35 debug1: Host '172.23.102.133' is known and matches the DSA host key. debug1: Found key in /users/adminweb/.ssh/known_hosts:35 debug2: bits set: 517/1024 debug1: ssh_dss_verify: signature correct debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /users/adminweb/.ssh/identity (0) debug2: key: /users/adminweb/.ssh/id_rsa (6000000000017a60) debug2: key: /users/adminweb/.ssh/id_dsa (0) debug3: input_userauth_banner debug1: Authentications that can continue: password debug3: start over, passed a different list password debug3: preferred password,keyboard-interactive,publickey debug3: authmethod_lookup password debug3: remaining preferred: keyboard-interactive,publickey debug3: authmethod_is_enabled password debug1: Next authentication method: password #3779 1415690488.00000 _init_transport: 35 bytes readed from pty: 69 73 61 64 6d 69 6e 40 31 37 32 2e 32 33 2e 31 30 32 2e 31 33 33 27 7 +3 20 70 61 73 73 77 6f 72 | isadmin@172.23.102.133's passwor 64 3a 20 + | d: #3779 1415690488.00000 _init_transport: looking for user/password prom +pt #3779 1415690488.00000 _init_transport: matching against (?i-xsm:(user +|name|login)?[:?]\s*$) #3779 1415690488.00000 _init_transport: sending password debug3: packet_send2: adding 64 (len 57 padlen 7 extra_pad 64) debug2: we sent a password packet, wait for reply #3779 1415690488.00000 _init_transport: checking timeout, max: 30, ell +apsed: 1.20858788490295 #3779 1415690488.00000 _init_transport: waiting for data from the pty +to become available #3779 1415690488.00000 _init_transport: 2 bytes readed from pty: 0d 0a + | .. #3779 1415690488.00000 _init_transport: looking for password ok #3779 1415690488.00000 _init_transport: password authentication done #3779 1415690488.00000 _queue_msg: queueing msg len: 5, code:1, id:3 . +.. [1] #3779 1415690488.00000 _get_msg: waiting for message... [1] #3779 1415690488.00000 _do_io: _do_io connected: 1 #3779 1415690488.00000 _do_io: _do_io select(-,-,-, 30) #3779 1415690488.00000 _do_io: _do_io write queue: 9, syswrite: 9, max +: 65536, $!: #3779 1415690488.00000 _do_io: _do_io select(-,-,-, 30) debug1: Authentications that can continue: password debug2: we did not send a packet, disable method debug1: No more authentication methods to try. Permission denied (password). #3779 1415690488.00000 _do_io: _do_io read sysread: 0, total read: 0, +$!: #3779 1415690488.00000 _conn_lost: _conn_lost #3779 1415690488.00000 _set_status: _set_status code: 7, str: Connecti +on lost #3779 1415690488.00000 _set_error: _set_err code: 37, str: Connection +to remote server is broken #3779 1415690488.00000 _conn_lost: _conn_lost 6565:No puedo conectar con el servidor sftp. #3779 1415690488.00000 DESTROY: Net::SFTP::Foreign=HASH(0x600000000083 +b580)->DESTROY called (current pid: 3779, disconnect_by_pid: ) #3779 1415690488.00000 disconnect: Net::SFTP::Foreign=HASH(0x600000000 +083b580)->disconnect called (ssh pid: 3781) #3779 1415690488.00000 _conn_lost: _conn_lost #3779 1415690488.00000 disconnect: starting dirty cleanup of process 3 +781 #3779 1415690488.00000 disconnect: killing process 3781 with signal 0 #3779 1415690488.00000 disconnect: waitpid returned 3781 #3779 1415690488.00000 disconnect: process 3781 reaped
I've tried to connect mannually and the result is :
$ sftp isadmin@172.23.102.133 isadmin@172.23.102.133's password: Connected to 172.23.102.133. sftp>
I've tried to connect between 2 HPUX machines an the result is :
#13553 1415691400.00000 new: This is Net::SFTP::Foreign 1.77 #13553 1415691400.00000 new: Loaded from /opt/perl_64/lib/site_perl/5. +8.8/Net/SFTP/Foreign.pm #13553 1415691400.00000 new: Running on Per for hpux #13553 1415691400.00000 new: debug set to 18446744073709548519 #13553 1415691400.00000 new: ~0 is 18446744073709551615 #13553 1415691400.00000 new: Using backend Net::SFTP::Foreign::Backend +::Unix 1.76_03 #13553 1415691400.00000 _init_transport: ssh cmd: ssh -o NumberOfPassw +ordPrompts=1 -o PreferredAuthentications=password,keyboard-interactiv +e,publickey -vvvv grafo6 -s sftp #13553 1415691400.00000 _init_transport: starting password authenticat +ion #13553 1415691400.00000 _init_transport: checking timeout, max: 10, el +lapsed: 5.38825988769531e-05 #13553 1415691400.00000 _init_transport: waiting for data from the pty + to become available OpenSSH_5.8p1+sftpfilecontrol-v1.3-hpn13v7, OpenSSL 0.9.8q 2 Dec 2010 HP-UX Secure Shell-A.05.80.004, HP-UX Secure Shell version debug1: Reading configuration data /opt/ssh/etc/ssh_config debug3: RNG is ready, skipping seeding debug2: ssh_connect: needpriv 0 debug1: Connecting to grafo6 [10.95.187.72] port 22. debug1: Connection established. debug1: identity file /users/adminweb/.ssh/identity type -1 debug1: identity file /users/adminweb/.ssh/identity-cert type -1 debug3: Incorrect RSA1 identifier debug3: Could not load "/users/adminweb/.ssh/id_rsa" as a RSA1 public +key debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype debug2: key_type_from_name: unknown key type 'Proc-Type:' debug3: key_read: missing keytype debug2: key_type_from_name: unknown key type 'DEK-Info:' debug3: key_read: missing keytype debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug2: key_type_from_name: unknown key type '-----END' debug3: key_read: missing keytype debug1: identity file /users/adminweb/.ssh/id_rsa type 1 debug1: identity file /users/adminweb/.ssh/id_rsa-cert type -1 debug3: Incorrect RSA1 identifier debug3: Could not load "/users/adminweb/.ssh/id_dsa" as a RSA1 public +key debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug2: key_type_from_name: unknown key type '-----END' debug3: key_read: missing keytype debug1: identity file /users/adminweb/.ssh/id_dsa type 2 debug1: identity file /users/adminweb/.ssh/id_dsa-cert type -1 debug1: identity file /users/adminweb/.ssh/id_ecdsa type -1 debug1: identity file /users/adminweb/.ssh/id_ecdsa-cert type -1 debug1: Remote protocol version 1.99, remote software version OpenSSH_ +5.8p1+sftpfilecontrol-v1.3-hpn13v7 debug1: match: OpenSSH_5.8p1+sftpfilecontrol-v1.3-hpn13v7 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.8p1+sftpfilecontrol-v1. +3-hpn13v7 debug2: fd 4 setting O_NONBLOCK debug3: load_hostkeys: loading entries for host "grafo6" from file "/u +sers/adminweb/.ssh/known_hosts" debug3: load_hostkeys: found key type ECDSA in file /users/adminweb/.s +sh/known_hosts:22 debug3: load_hostkeys: loaded 1 keys debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cer +t-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2 +-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp38 +4,ecdsa-sha2-nistp521 debug3: RNG is ready, skipping seeding debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: AUTH STATE IS 0 debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh- +sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-gro +up-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sh +a1 debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ec +dsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@o +penssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp52 +1,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-c +ert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256 +,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,a +es256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256 +,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,a +es256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac +-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac +-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh- +sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-gro +up-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sh +a1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256 debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256 +,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,a +es256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256 +,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,a +es256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac +-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac +-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com debug2: kex_parse_kexinit: none,zlib@openssh.com debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-md5 debug1: REQUESTED ENC.NAME is 'aes128-ctr' debug1: kex: server->client aes128-ctr hmac-md5 none debug2: mac_setup: found hmac-md5 debug1: REQUESTED ENC.NAME is 'aes128-ctr' debug1: kex: client->server aes128-ctr hmac-md5 none debug1: sending SSH2_MSG_KEX_ECDH_INIT debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ECDSA 2e:71:0c:dd:a8:b2:f3:4f:9c:3f:45:ec:86: +70:82:0a debug3: load_hostkeys: loading entries for host "grafo6" from file "/u +sers/adminweb/.ssh/known_hosts" debug3: load_hostkeys: found key type ECDSA in file /users/adminweb/.s +sh/known_hosts:22 debug3: load_hostkeys: loaded 1 keys debug3: load_hostkeys: loading entries for host "10.95.187.72" from fi +le "/users/adminweb/.ssh/known_hosts" debug3: load_hostkeys: found key type ECDSA in file /users/adminweb/.s +sh/known_hosts:23 debug3: load_hostkeys: loaded 1 keys debug1: Host 'grafo6' is known and matches the ECDSA host key. debug1: Found key in /users/adminweb/.ssh/known_hosts:22 debug1: ssh_ecdsa_verify: signature correct debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /users/adminweb/.ssh/identity (0) debug2: key: /users/adminweb/.ssh/id_rsa (600000000005ba40) debug2: key: /users/adminweb/.ssh/id_dsa (600000000005b9f0) debug2: key: /users/adminweb/.ssh/id_ecdsa (0) debug1: Authentications that can continue: publickey,password,keyboard +-interactive debug3: start over, passed a different list publickey,password,keyboar +d-interactive debug3: preferred password,keyboard-interactive,publickey debug3: authmethod_lookup password debug3: remaining preferred: keyboard-interactive,publickey debug3: authmethod_is_enabled password debug1: Next authentication method: password #13553 1415691400.00000 _init_transport: 28 bytes readed from pty: 61 64 6d 69 6e 77 65 62 40 67 72 61 66 6f 36 27 73 20 70 61 73 73 77 6 +f 72 64 3a 20 | adminweb@grafo6's password: #13553 1415691400.00000 _init_transport: looking for user/password pro +mpt #13553 1415691400.00000 _init_transport: matching against (?i-xsm:(use +r|name|login)?[:?]\s*$) #13553 1415691400.00000 _init_transport: sending password debug3: packet_send2: adding 48 (len 61 padlen 19 extra_pad 64) debug2: we sent a password packet, wait for reply #13553 1415691400.00000 _init_transport: checking timeout, max: 10, el +lapsed: 0.283391952514648 #13553 1415691400.00000 _init_transport: waiting for data from the pty + to become available #13553 1415691400.00000 _init_transport: 2 bytes readed from pty: 0d 0a + | .. #13553 1415691400.00000 _init_transport: looking for password ok #13553 1415691400.00000 _init_transport: password authentication done #13553 1415691400.00000 _queue_msg: queueing msg len: 5, code:1, id:3 +... [1] #13553 1415691400.00000 _get_msg: waiting for message... [1] #13553 1415691400.00000 _do_io: _do_io connected: 1 #13553 1415691400.00000 _do_io: _do_io select(-,-,-, 10) #13553 1415691400.00000 _do_io: _do_io write queue: 9, syswrite: 9, ma +x: 65536, $!: #13553 1415691400.00000 _do_io: _do_io select(-,-,-, 10) debug1: Authentication succeeded (password). Authenticated to grafo6 ([10.95.187.72]:22). debug2: fd 5 setting O_NONBLOCK debug2: fd 6 setting O_NONBLOCK debug1: Final hpn_buffer_size = 2097152 debug1: HPN Disabled: 1, HPN Buffer Size: 2097152 debug1: channel 0: new [client-session] debug3: ssh_session2_open: channel_new: 0 debug2: channel 0: send open debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug2: callback start debug2: client_session2_setup: id 0 debug2: fd 4 setting TCP_NODELAY debug3: packet_set_tos: set IP_TOS 0x08 debug1: Sending subsystem: sftp debug2: channel 0: request subsystem confirm 1 debug2: callback done debug2: channel 0: open confirm rwindow 0 rmax 32768 debug2: channel 0: rcvd adjust 65536 debug2: channel_input_status_confirm: type 99 id 0 debug2: subsystem request accepted on channel 0 #13553 1415691401.00000 _do_io: _do_io read sysread: 128, total read: +128, $!: #13553 1415691401.00000 _get_msg: got it!, len:124, code:2, id:-, stat +us: - OK #13553 1415691401.00000 DESTROY: Net::SFTP::Foreign=HASH(0x60000000008 +3a4d0)->DESTROY called (current pid: 13553, disconnect_by_pid: ) #13553 1415691401.00000 disconnect: Net::SFTP::Foreign=HASH(0x60000000 +0083a4d0)->disconnect called (ssh pid: 13555) #13553 1415691401.00000 _conn_lost: _conn_lost #13553 1415691401.00000 _set_status: _set_status code: 7, str: Connect +ion lost #13553 1415691401.00000 _set_error: _set_err code: 37, str: Connection + to remote server is broken #13553 1415691401.00000 disconnect: debug2: channel 0: read<=0 rfd 5 l +en 0 debug2: channel 0: read failed debug2: channel 0: close_read debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed starting dirty cleanup of process 13555 debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: channel 0: close_write debug2: channel 0: output drain -> closed #13553 1415691401.00000 disconnect: killing process 13555 with signal +0 debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug2: channel 0: rcvd close debug3: channel 0: will not send data after close debug2: channel 0: almost dead debug2: channel 0: gc: notify user debug2: channel 0: gc: user detached debug2: channel 0: send close debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: client-session, nchannels 1 debug3: channel 0: status: The following connections are open: #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1) debug1: fd 0 clearing O_NONBLOCK debug1: fd 1 clearing O_NONBLOCK Transferred: sent 1704, received 1600 bytes, in 0.1 seconds Bytes per second: sent 17402.7, received 16340.6 debug1: Exit status 0 debug1: main thread: 0 drains, 0 waits debug1: tid 2 - 4 fills, 0 skips, 1 waits debug1: tid 3 - 0 fills, 4 skips, 1 waits debug1: main thread: 0 drains, 0 waits debug1: tid 4 - 4 fills, 0 skips, 1 waits debug1: tid 5 - 0 fills, 4 skips, 1 waits #13553 1415691401.00000 disconnect: waitpid returned 13555 #13553 1415691401.00000 disconnect: process 13555 reaped
Any help would be MUCH appreciated

Replies are listed 'Best First'.
Re: Net::SFTP::Foreign doesn't work with some Alcatel equipment
by salva (Canon) on Nov 11, 2014 at 08:11 UTC
    Basically that logs tells you that the password is wrong.

    Are there any special characters there? you may need to escape them on your perl code.

      Hello Salva, thanks for your quick reply
      The password is in the example "ANS#150" I've escape this password "ANS\#150" and doesn't work either
      I'm very frustrated . . . :-(
        Once you are completely sure that the IP, username and password are right, next step is to use tusc to see what's happening at the OS level and compare the successful manual login with the unsuccessful automated one.

        Hey, look at this bug report: https://rt.cpan.org/Ticket/Display.html?id=67576, it seems you are not the first one facing that issue!!!

        Once upon a time, HP offered free access to HP-UX machines for FLOSS developers and I was able to test Net::SFTP::Foreign there, but they stopped doing that so now, troubleshooting on that platform is mostly on the hands of its users.