Skip to content

Instantly share code, notes, and snippets.

@roccomuso
roccomuso / Interactive-SSH-Client.js
Created April 20, 2017 13:56
SSH Interactive shell session in Node.js
var Client = require('ssh2').Client;
var readline = require('readline')
var conn = new Client();
conn.on('ready', function() {
console.log('Client :: ready');
conn.shell(function(err, stream) {
if (err) throw err;
// create readline interface
var rl = readline.createInterface(process.stdin, process.stdout)