se

ssh-executor

SSH command executor for Node.js written in C++ using libssh2

Showing:

Popularity

Downloads/wk

2

GitHub Stars

1

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100