Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-ssh

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-ssh - npm Package Compare versions

Comparing version 0.8.2 to 0.8.3

28

lib/ssh.js

@@ -13,2 +13,3 @@ 'use strict';

* @param {String} config.pass - Password
* @param {String} [config.passphase=''] - Passphrase
* @param {String} [config.baseDir=''] - Base directory to perform commands from

@@ -27,2 +28,3 @@ * @param {String} [config.agent=''] - SSH Agent to connect with

key: '',
passphrase: '',
baseDir: '',

@@ -42,2 +44,3 @@ agent: '',

this.key = config.key;
this.passphrase = config.passphrase;
this.baseDir = config.baseDir;

@@ -88,3 +91,3 @@ this.agent = config.agent;

stream.on('data', function(data, extended) {
stream.on('data', function(data) {
// This will allow us to send in the password if we're doing something like `sudo`

@@ -198,9 +201,16 @@ buffer += (!passwordSent) ? data.toString() : '';

} else if (!self.pass && self.key) {
self._c.connect({
host: self.host,
port: self.port || 22,
username: self.user,
privateKey: self.key,
readyTimeout: self.timeout
});
try {
self._c.connect({
host: self.host,
port: self.port || 22,
username: self.user,
privateKey: self.key,
passphrase: self.passphrase,
readyTimeout: self.timeout
});
} catch (err) {
self._c.emit('error', new Error('Incorrect passphrase: ' + err.toString()));
return this;
}
} else if (self.pass && self.key) {

@@ -284,2 +294,2 @@ self._c.connect({

module.exports = SSH;
module.exports = SSH;
{
"name": "simple-ssh",
"version": "0.8.2",
"version": "0.8.3",
"description": "A wrapper for ssh2 to make it easier to perform commands over SSH",

@@ -5,0 +5,0 @@ "keywords": [

@@ -77,9 +77,9 @@ # simple-ssh

.exec('echo "Node.js"', {
out: console.log
out: console.log.bind(console)
})
.exec('echo "is"', {
out: console.log
out: console.log.bind(console)
})
.exec('echo "awesome!"', {
out: console.log
out: console.log.bind(console)
})

@@ -110,3 +110,3 @@ .start();

pty: true,
out: console.log
out: console.log.bind(console)
}).start();

@@ -173,2 +173,3 @@ ```

* **config.key** { _String_ }: SSH key
* **config.passphrase** { _String_ }: Passphrase
* **config.baseDir** { _String_ }: Base directory. If this is set, each command will be preceeded by `cd ${this.baseDir}`

@@ -202,3 +203,3 @@ * **config.agent** { _String_ }: Connects with the given SSH agent. If this is set, no need to specify a private key or password.

* **end**(): **Ends the SSH session** (this is automatically called at the end of a command queue).
### Properties

@@ -205,0 +206,0 @@

@@ -5,2 +5,3 @@ 'use strict';

expect = require('expect.js'),
fs = require('fs'),

@@ -11,2 +12,6 @@ config = require('../config/ssh.json'),

describe('SSH', function() {
if (config.key) {
config.key = fs.readFileSync(config.key);
}
beforeEach(function() {

@@ -253,2 +258,2 @@ ssh = new SSH(config);

});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc