Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Net::OpenSSH help needed

by salva (Abbot)
on Jul 30, 2013 at 10:57 UTC ( #1046991=note: print w/ replies, xml ) Need Help??


in reply to Net::OpenSSH help needed

Activate debugging on the module and post here the output:

$Net::OpenSSH::debug = -1;


Comment on Re: Net::OpenSSH help needed
Download Code
Re^2: Net::OpenSSH help needed
by Andy16 (Acolyte) on Jul 30, 2013 at 11:33 UTC
    # ctl_path: /tmp/Ssh.18151/willnotwork-user-MUC-18151-77876, ctl_dir: +/tmp/Ssh.18151/ # set_error(0 - 0) # call args: ['ssh','-o','StrictHostKeyChecking=no','-o','ServerAliveI +nterval=30','-x2MN','-o','NumberOfPasswordPrompts=1','-o','PreferredA +uthentications=keyboard-interactive,password','-S','/tmp/Ssh.18151/wi +llnotwork-user-MUC-18151-77876','-l','willnotwork-user','MYDEVICE','- +-'] doing ssh # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # tracer attached, ssh pid: 18166, tracer pid: 18167 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 [remove tons of lines] # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 Welcome # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # passwd/passphrase requested (willnotwork-user@MYDEVICE's password:) # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object not yet found at /tmp/Ssh.18151/willnotwork-user-MUC-181 +51-77876 # file object found at /tmp/Ssh.18151/willnotwork-user-MUC-18151-77876 # call args: ['ssh','-O','check','-T','-S','/tmp/Ssh.18151/willnotwork +-user-MUC-18151-77876','-l','willnotwork-user','MYDEVICE','--'] # open_ex: ['ssh','-O','check','-T','-S','/tmp/Ssh.18151/willnotwork-u +ser-MUC-18151-77876','-l','willnotwork-user','MYDEVICE','--'] # io3 mloop, cin: 0, cout: 1, cerr: 0 # io3 fast, cin: 0, cout: 1, cerr: 0 # stdout, bytes read: 28 at offset 0 #> 4d 61 73 74 65 72 20 72 75 6e 6e 69 6e 67 20 28 70 69 64 3d 31 38 3 +1 36 36 29 0d 0a | Master running (pid=18166).. # io3 fast, cin: 0, cout: 1, cerr: 0 # stdout, bytes read: 0 at offset 28 # leaving _io3() # waiting for slave, timeout: 90, remaining: 90, sleep: 1 # _waitpid(20526) => pid: 20526, rc: Interrupted system call # DESTROY(Net::OpenSSH=HASH(0x96fe218), pid: 18166) # killing master # sending exit control to master # call args: ['ssh','-O','exit','-T','-S','/tmp/Ssh.18151/willnotwork- +user-MUC-18151-77876','-l','willnotwork-user','MYDEVICE','--'] # open_ex: ['ssh','-O','exit','-T','-S','/tmp/Ssh.18151/willnotwork-us +er-MUC-18151-77876','-l','willnotwork-user','MYDEVICE','--'] did ssh (0) # io3 mloop, cin: 0, cout: 1, cerr: 0 # io3 fast, cin: 0, cout: 1, cerr: 0 # stdout, bytes read: 20 at offset 0 #> 45 78 69 74 20 72 65 71 75 65 73 74 20 73 65 6e 74 2e 0d 0a + | Exit request sent... # io3 fast, cin: 0, cout: 1, cerr: 0 # stdout, bytes read: 0 at offset 20 # leaving _io3() # _waitpid(20527) => pid: 20527, rc: # _kill_master: 18166 # waitpid(master: 18166) => pid: 0, rc: # waitpid(master: 18166) => pid: 18166, rc: Interrupted system call



    from cmd line:
    ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -x2MN -o NumberOfPasswordPrompts=1 -o PreferredAuthentications=keyboard-interactive,password -l willnotwork-user MYDEVICE

    Welcome willnotwork-user@MYDEVICE's password: Connection closed by 123.123.123.123
      Strange, the connection seems to be established correctly even when the authentication fails.

      Enable debugging also for the ssh binary:

      $Net::OpenSSH::debug = -1; $ssh = Net::OpenSSH->new( $device, user => $sshuser, passwd => $sshpwd, ctl_dir => "/tmp/ssh.$$", master_opts => [-o => "StrictHostKeyChecking=no", '-vvv'], timeout => 90, kill_ssh_on_timeout => 1, strict_mode => 0 ); print STDERR "ssh error: " . $ssh->error . "\n";
        # ctl_path: /tmp/Ssh.32125/willnotwork-user-MUC-32125-271664, ctl_dir: + /tmp/Ssh.32125/ # set_error(0 - 0) # call args: ['ssh','-o','StrictHostKeyChecking=no','-vvv','-o','Serve +rAliveInterval=30','-x2MN','-o','NumberOfPasswordPrompts=1','-o','Pre +ferredAuthentications=keyboard-interactive,password','-S','/tmp/Ssh.3 +2125/willnotwork-user-MUC-32125-271664','-l','willnotwork-user','MYDE +VICE','--'] doing ssh # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # tracer attached, ssh pid: 32128, tracer pid: 32129 OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to MYDEVICE [172.24.57.37] port 22. debug1: Connection established. debug3: Not a RSA1 key file /home/myuser/.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 /home/myuser/.ssh/id_rsa type 1 debug1: identity file /home/myuser/.ssh/id_dsa type -1 debug1: loaded 2 keys # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 .... # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 debug1: Remote protocol version 2.0, remote software version OpenSSH_5 +.2 debug1: match: OpenSSH_5.2 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_4.3 debug2: fd 3 setting O_NONBLOCK debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-h +ellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: 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,hmac-ripemd160,hmac-ripe +md160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripe +md160@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-group-exchange-sha256,diffie +-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellm +an-group1-sha1 debug2: kex_parse_kexinit: 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 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_init: found hmac-md5 debug1: kex: server->client aes128-ctr hmac-md5 none debug2: mac_init: found hmac-md5 debug1: kex: client->server aes128-ctr hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug2: dh_gen_key: priv key bits set: 131/256 debug2: bits set: 522/1024 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug3: check_host_in_hostfile: filename /home/myuser/.ssh/known_hosts debug3: check_host_in_hostfile: match line 782 debug3: check_host_in_hostfile: filename /home/myuser/.ssh/known_hosts debug3: check_host_in_hostfile: match line 782 debug1: Host 'MYDEVICE' is known and matches the RSA host key. debug1: Found key in /home/myuser/.ssh/known_hosts:782 debug2: bits set: 513/1024 debug1: ssh_rsa_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: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /home/myuser/.ssh/id_rsa (0x2b9fa859a8a0) debug2: key: /home/myuser/.ssh/id_dsa ((nil)) debug3: input_userauth_banner Welcome debug1: Authentications that can continue: password debug3: start over, passed a different list password debug3: preferred keyboard-interactive,password debug3: authmethod_lookup password debug3: remaining preferred: ,password debug3: authmethod_is_enabled password debug1: Next authentication method: password # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # passwd/passphrase requested (willnotwork-user@MYDEVICE's password:) # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 # file object not yet found at /tmp/Ssh.32125/willnotwork-user-MUC-321 +25-271664 debug3: packet_send2: adding 48 (len 76 padlen 4 extra_pad 64) debug2: we sent a password packet, wait for reply debug1: Authentication succeeded (password). debug1: setting up multiplex master socket debug2: fd 4 setting O_NONBLOCK debug1: Entering interactive session. # file object found at /tmp/Ssh.32125/willnotwork-user-MUC-32125-27166 +4 # call args: ['ssh','-O','check','-T','-S','/tmp/Ssh.32125/willnotwork +-user-MUC-32125-271664','-l','willnotwork-user','MYDEVICE','--'] # open_ex: ['ssh','-O','check','-T','-S','/tmp/Ssh.32125/willnotwork-u +ser-MUC-32125-271664','-l','willnotwork-user','MYDEVICE','--'] # io3 mloop, cin: 0, cout: 1, cerr: 0 # io3 fast, cin: 0, cout: 1, cerr: 0 debug3: fd 5 is not O_NONBLOCK debug3: ssh_msg_recv entering debug3: ssh_msg_send: type 1 # stdout, bytes read: 28 at offset 0 #> 4d 61 73 74 65 72 20 72 75 6e 6e 69 6e 67 20 28 70 69 64 3d 33 32 3 +1 32 38 29 0d 0a | Master running (pid=32128).. # io3 fast, cin: 0, cout: 1, cerr: 0 # stdout, bytes read: 0 at offset 28 # leaving _io3() # _waitpid(1312) => pid: 1312, rc: # DESTROY(Net::OpenSSH=HASH(0x9b97270), pid: 32128) # killing master # sending exit control to master # call args: ['ssh','-O','exit','-T','-S','/tmp/Ssh.32125/willnotwork- +user-MUC-32125-271664','-l','willnotwork-user','MYDEVICE','--'] # open_ex: ['ssh','-O','exit','-T','-S','/tmp/Ssh.32125/willnotwork-us +er-MUC-32125-271664','-l','willnotwork-user','MYDEVICE','--'] did ssh (0) # io3 mloop, cin: 0, cout: 1, cerr: 0 # io3 fast, cin: 0, cout: 1, cerr: 0 debug3: fd 5 is not O_NONBLOCK debug3: ssh_msg_recv entering debug3: ssh_msg_send: type 1 debug3: fd 1 is not O_NONBLOCK debug3: fd 2 is not O_NONBLOCK debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.2 seconds debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0 debug1: Exit status -1 # stdout, bytes read: 20 at offset 0 #> 45 78 69 74 20 72 65 71 75 65 73 74 20 73 65 6e 74 2e 0d 0a + | Exit request sent... # io3 fast, cin: 0, cout: 1, cerr: 0 # stdout, bytes read: 0 at offset 20 # leaving _io3() # _waitpid(1313) => pid: 1313, rc: # _kill_master: 32128 # waitpid(master: 32128) => pid: 32128, rc:

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-12-20 00:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (94 votes), past polls