0.0.6 • Published 7 years ago

ssh-executor v0.0.6

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

ssh-executor

Simple ssh executor for Node.js written in C++ using libssh2. Returns terminal output after successful command execution. Currently works on Linux only.

Installation

You need to have libssh2 installed on your computer:

$ sudo apt-get install libssh2-1-dev

Also, make sure Node-gyp module is installed (in order to compile C++ code into a Node addon):

$ npm install -g node-gyp

Then you can proceed with npm installation:

$ npm install ssh-executor

Usage

const ssh = require('ssh-executor');

ssh.connect({ // Establish connection
	host: "127.0.0.1",
	port: '22',
	username: "yourusername",
	password: 'yourpassword'
}, (err) => {
	if(!err) {
		console.log('Successfully connected!');
	}
});

ssh.exec('echo NOBODY EXPECTS THE SPANISH INQUISITION!', (result, err) => {
	if(!err) {
		console.log(result); //NOBODY EXPECTS THE SPANISH INQUISITION!
	}
}); // Execute your command

ssh.close(); // Close your SSH connection.
0.0.6

7 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago