From b565f5595d255e6e8149abe82dfacc2d9cff7c07 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Tue, 31 Mar 2020 21:27:04 -0700 Subject: [PATCH] Support SSH password authentication SSH password authentication is quite common and with a strong password can be quite secure. Let's support it in docker-modem and dockerode. --- lib/modem.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/modem.js b/lib/modem.js index 67e461f..003b5a0 100644 --- a/lib/modem.js +++ b/lib/modem.js @@ -75,6 +75,7 @@ var Modem = function (options) { this.host = opts.host; this.port = opts.port; this.username = opts.username; + this.password = opts.password; this.version = opts.version; this.key = opts.key; this.cert = opts.cert; @@ -206,7 +207,7 @@ Modem.prototype.buildRequest = function (options, context, data, callback) { var connectionTimeoutTimer; var opts = self.protocol === 'ssh' ? Object.assign(options, { - agent: ssh({ 'host': self.host, 'port': self.port, 'username': self.username, 'agent': self.sshAuthAgent }), + agent: ssh({ 'host': self.host, 'port': self.port, 'username': self.username, 'password': self.password, 'agent': self.sshAuthAgent }), protocol: 'http:' }) : options;