Skip to content

Commit

Permalink
Support SSH password authentication
Browse files Browse the repository at this point in the history
SSH password authentication is quite common and with a strong password can be quite secure. Let's support it in docker-modem and dockerode.
  • Loading branch information
feross committed Apr 1, 2020
1 parent 3d793be commit b565f55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/modem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit b565f55

Please sign in to comment.