node-lei-ssh
simple ssh client
var client = new SSHClient({
host: '127.0.0.1',
port: 22,
username: 'glen',
privateKey: require('fs').readFileSync('/Users/glen/.ssh/id_rsa')
});
client.connect(function (err) {
if (err) throw err;
console.log('connected.');
client.exec(['ls -l', 'ls -al'], function (err, stream) {
if (err) throw err;
stream.on('data', function (d) {
console.log(d.toString());
});
stream.on('end', function () {
console.log('done.');
client.end();
});
});
});