{"action":"created","issue":{"url":"https://api.github.com/repos/mscdex/ssh2/issues/394","repository_url":"https://api.github.com/repos/mscdex/ssh2","labels_url":"https://api.github.com/repos/mscdex/ssh2/issues/394/labels{/name}","comments_url":"https://api.github.com/repos/mscdex/ssh2/issues/394/comments","events_url":"https://api.github.com/repos/mscdex/ssh2/issues/394/events","html_url":"https://github.com/mscdex/ssh2/issues/394","id":131184628,"number":394,"title":"password authentication fails with \"Client: none auth failed\" with SSH-2.0-OpenSSH_6.2","user":{"login":"soichih","id":923896,"avatar_url":"https://avatars.githubusercontent.com/u/923896?v=3","gravatar_id":"","url":"https://api.github.com/users/soichih","html_url":"https://github.com/soichih","followers_url":"https://api.github.com/users/soichih/followers","following_url":"https://api.github.com/users/soichih/following{/other_user}","gists_url":"https://api.github.com/users/soichih/gists{/gist_id}","starred_url":"https://api.github.com/users/soichih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soichih/subscriptions","organizations_url":"https://api.github.com/users/soichih/orgs","repos_url":"https://api.github.com/users/soichih/repos","events_url":"https://api.github.com/users/soichih/events{/privacy}","received_events_url":"https://api.github.com/users/soichih/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-02-03T23:07:48Z","updated_at":"2016-02-04T01:51:37Z","closed_at":null,"body":"I have a SSH server where I can login with user/pass via command line ssh client, but not with node-ssh2 client.\r\n\r\nHere is the code I am executing\r\n\r\n```\r\n'use strict';\r\nvar Client = require('ssh2').Client;\r\nvar conn = new Client();\r\nconn.connect({\r\n    debug: function(log) {\r\n        console.log(log);\r\n    },\r\n    host: \"bigred2.uits.iu.edu\",\r\n    port: 22,\r\n    username: \"hayashis\",\r\n    password: \"-------------------\",\r\n});\r\n```\r\n\r\nHere is the full output.\r\n```\r\n$ node connect.js\r\nDEBUG: Local ident: 'SSH-2.0-ssh2js0.0.20'\r\nDEBUG: Client: Trying bigred2.uits.iu.edu on port 22 ...\r\nDEBUG: Client: Connected\r\nDEBUG: Parser: IN_INIT\r\nDEBUG: Parser: IN_GREETING\r\nDEBUG: Parser: IN_HEADER\r\nDEBUG: Remote ident: 'SSH-2.0-OpenSSH_6.2'\r\nDEBUG: Outgoing: Writing KEXINIT\r\nDEBUG: Parser: IN_PACKETBEFORE (expecting 8)\r\nDEBUG: Parser: IN_PACKET\r\nDEBUG: Parser: pktLen:1452,padLen:11,remainLen:1448\r\nDEBUG: Parser: IN_PACKETDATA\r\nDEBUG: Parser: IN_PACKETDATAAFTER, packet: KEXINIT\r\nDEBUG: Comparing KEXINITs ...\r\nDEBUG: (local) KEX algorithms: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\nDEBUG: (remote) KEX algorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\nDEBUG: KEX algorithm: diffie-hellman-group14-sha1\r\nDEBUG: (local) Host key formats: ssh-rsa,ssh-dss\r\nDEBUG: (remote) Host key formats: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256\r\nDEBUG: Host key format: ssh-rsa\r\nDEBUG: (local) Client->Server ciphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc,3des-cbc,arcfour256,arcfour128,cast128-cbc,arcfour\r\nDEBUG: (remote) Client->Server ciphers: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\nDEBUG: Client->Server Cipher: aes256-ctr\r\nDEBUG: (local) Server->Client ciphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc,3des-cbc,arcfour256,arcfour128,cast128-cbc,arcfour\r\nDEBUG: (remote) Server->Client ciphers: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\nDEBUG: Server->Client Cipher: aes256-ctr\r\nDEBUG: (local) Client->Server HMAC algorithms: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-sha1-96,hmac-md5-96\r\nDEBUG: (remote) Client->Server HMAC algorithms: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\nDEBUG: Client->Server HMAC algorithm: hmac-md5\r\nDEBUG: (local) Server->Client HMAC algorithms: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-sha1-96,hmac-md5-96\r\nDEBUG: (remote) Server->Client HMAC algorithms: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\nDEBUG: Server->Client HMAC algorithm: hmac-md5\r\nDEBUG: (local) Client->Server compression algorithms: none\r\nDEBUG: (remote) Client->Server compression algorithms: none,zlib@openssh.com\r\nDEBUG: Client->Server compression algorithm: none\r\nDEBUG: (local) Server->Client compression algorithms: none\r\nDEBUG: (remote) Server->Client compression algorithms: none,zlib@openssh.com\r\nDEBUG: Server->Client compression algorithm: none\r\nDEBUG: Outgoing: Writing KEXDH_INIT\r\nDEBUG: Parser: IN_PACKETBEFORE (expecting 8)\r\nDEBUG: Parser: IN_PACKET\r\nDEBUG: Parser: pktLen:828,padLen:10,remainLen:824\r\nDEBUG: Parser: IN_PACKETDATA\r\nDEBUG: Parser: IN_PACKETDATAAFTER, packet: KEXDH_REPLY\r\nDEBUG: Checking host key format\r\nDEBUG: Checking signature format\r\nDEBUG: Verifying host fingerprint\r\nDEBUG: Host accepted by default (no verification)\r\nDEBUG: Verifying signature\r\nDEBUG: Outgoing: Writing NEWKEYS\r\nDEBUG: Parser: IN_PACKETBEFORE (expecting 8)\r\nDEBUG: Parser: IN_PACKET\r\nDEBUG: Parser: pktLen:12,padLen:10,remainLen:8\r\nDEBUG: Parser: IN_PACKETDATA\r\nDEBUG: Parser: IN_PACKETDATAAFTER, packet: NEWKEYS\r\nDEBUG: Outgoing: Writing SERVICE_REQUEST (ssh-userauth)\r\nDEBUG: Parser: IN_PACKETBEFORE (expecting 16)\r\nDEBUG: Parser: IN_PACKET\r\nDEBUG: Parser: Decrypting\r\nDEBUG: Parser: pktLen:28,padLen:10,remainLen:16\r\nDEBUG: Parser: IN_PACKETDATA\r\nDEBUG: Parser: Decrypting\r\nDEBUG: Parser: HMAC size:16\r\nDEBUG: Parser: IN_PACKETDATAVERIFY\r\nDEBUG: Parser: Verifying MAC\r\nDEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC)\r\nDEBUG: Parser: IN_PACKETDATAAFTER, packet: SERVICE_ACCEPT\r\nDEBUG: Outgoing: Writing USERAUTH_REQUEST (password)\r\nDEBUG: Parser: IN_PACKETBEFORE (expecting 16)\r\nDEBUG: Parser: IN_PACKET\r\nDEBUG: Parser: Decrypting\r\nDEBUG: Parser: pktLen:44,padLen:7,remainLen:32\r\nDEBUG: Parser: IN_PACKETDATA\r\nDEBUG: Parser: Decrypting\r\nDEBUG: Parser: HMAC size:16\r\nDEBUG: Parser: IN_PACKETDATAVERIFY\r\nDEBUG: Parser: Verifying MAC\r\nDEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC)\r\nDEBUG: Parser: IN_PACKETDATAAFTER, packet: USERAUTH_FAILURE\r\nDEBUG: Client: password auth failed\r\nDEBUG: Outgoing: Writing USERAUTH_REQUEST (none)\r\nDEBUG: Parser: IN_PACKETBEFORE (expecting 16)\r\nDEBUG: Parser: IN_PACKET\r\nDEBUG: Parser: Decrypting\r\nDEBUG: Parser: pktLen:44,padLen:7,remainLen:32\r\nDEBUG: Parser: IN_PACKETDATA\r\nDEBUG: Parser: Decrypting\r\nDEBUG: Parser: HMAC size:16\r\nDEBUG: Parser: IN_PACKETDATAVERIFY\r\nDEBUG: Parser: Verifying MAC\r\nDEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC)\r\nDEBUG: Parser: IN_PACKETDATAAFTER, packet: USERAUTH_FAILURE\r\nDEBUG: Client: none auth failed\r\n\r\nevents.js:72\r\n        throw er; // Unhandled 'error' event\r\n              ^\r\nError: All configured authentication methods failed\r\n    at tryNextAuth (/home/hayashis/test/nodejs/node_modules/ssh2/lib/client.js:292:17)\r\n    at SSH2Stream.onUSERAUTH_FAILURE (/home/hayashis/test/nodejs/node_modules/ssh2/lib/client.js:471:5)\r\n    at SSH2Stream.emit (events.js:98:17)\r\n    at parsePacket (/home/hayashis/test/nodejs/node_modules/ssh2-streams/lib/ssh.js:3652:10)\r\n    at SSH2Stream._transform (/home/hayashis/test/nodejs/node_modules/ssh2-streams/lib/ssh.js:557:13)\r\n    at SSH2Stream.Transform._read [as __read] (_stream_transform.js:179:10)\r\n    at SSH2Stream._read (/home/hayashis/test/nodejs/node_modules/ssh2-streams/lib/ssh.js:213:15)\r\n    at SSH2Stream.Transform._write (_stream_transform.js:167:12)\r\n    at doWrite (_stream_writable.js:226:10)\r\n    at writeOrBuffer (_stream_writable.js:216:5)\r\n```\r\n\r\nI am not sure what \"none auth\" is, but I believe this is a bug on node-ssh2.. I can login fine with username&privateKey however, and I can login fine to another SSH server with username/password (which shares the same ADS/LDAP authentication with the machine that's failing) The only difference between the two servers as far as I know is that the working SSH server is running OpenSSH 5.3 instead of 6.2.\r\n\r\nThank you!\r\nSoichi"},"comment":{"url":"https://api.github.com/repos/mscdex/ssh2/issues/comments/179570319","html_url":"https://github.com/mscdex/ssh2/issues/394#issuecomment-179570319","issue_url":"https://api.github.com/repos/mscdex/ssh2/issues/394","id":179570319,"user":{"login":"mscdex","id":54666,"avatar_url":"https://avatars.githubusercontent.com/u/54666?v=3","gravatar_id":"","url":"https://api.github.com/users/mscdex","html_url":"https://github.com/mscdex","followers_url":"https://api.github.com/users/mscdex/followers","following_url":"https://api.github.com/users/mscdex/following{/other_user}","gists_url":"https://api.github.com/users/mscdex/gists{/gist_id}","starred_url":"https://api.github.com/users/mscdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscdex/subscriptions","organizations_url":"https://api.github.com/users/mscdex/orgs","repos_url":"https://api.github.com/users/mscdex/repos","events_url":"https://api.github.com/users/mscdex/events{/privacy}","received_events_url":"https://api.github.com/users/mscdex/received_events","type":"User","site_admin":false},"created_at":"2016-02-04T01:51:37Z","updated_at":"2016-02-04T01:51:37Z","body":"Yes, that would be ideal. However you want to handle the prompts (automated or otherwise) is up to you obviously, but the example I gave was merely to show how you would *respond* to a prompt if 'keyboard-interactive' auth is tried."}}