lei-ssh

0.0.2 • Public • Published

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();
    });
  });
});

Readme

Keywords

Package Sidebar

Install

npm i lei-ssh

Weekly Downloads

2

Version

0.0.2

License

MIT

Last publish

Collaborators

  • leizongmin