From 3e904a68a2d754e57e517580a5edc66ef8f2ce15 Mon Sep 17 00:00:00 2001 From: sbalakrishnan Date: Thu, 5 Nov 2015 18:01:16 -0800 Subject: [PATCH 1/2] Fixed ssh2 issue for keyboard interaction on Mac OS X Yosemite + --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index b867b45..90331ff 100644 --- a/index.js +++ b/index.js @@ -189,7 +189,13 @@ module.exports = function (options) { connection_options.readyTimeout = options.timeout; } - c.connect(connection_options); + connection_options.tryKeyboard = true; + c.on('keyboard-interactive', + function(name, instructions, instructionsLang, prompts, finish) { + // Pass answers to `prompts` to `finish()`. Typically `prompts.length === 1` + // with `prompts[0] === "Password: "` + finish([connection_options.password]); + }).connect(connection_options); /* * end connection options From bd8bff8c860012e216908963a430d9ced141462f Mon Sep 17 00:00:00 2001 From: sbalakrishnan Date: Thu, 5 Nov 2015 18:02:44 -0800 Subject: [PATCH 2/2] Formatting --- index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/index.js b/index.js index 90331ff..b34352e 100644 --- a/index.js +++ b/index.js @@ -192,9 +192,7 @@ module.exports = function (options) { connection_options.tryKeyboard = true; c.on('keyboard-interactive', function(name, instructions, instructionsLang, prompts, finish) { - // Pass answers to `prompts` to `finish()`. Typically `prompts.length === 1` - // with `prompts[0] === "Password: "` - finish([connection_options.password]); + finish([connection_options.password]); }).connect(connection_options); /*