ssh-exec

Execute a script over ssh using Node.JS

Github星跟蹤圖

ssh-exec

Execute a script over ssh using Node.JS and pipe to and from it

It is available through npm

npm install ssh-exec

It is written in plain Javascript and uses ssh2 for all the heavy lifting.

Usage

var exec = require('ssh-exec')

// using ~/.ssh/id_rsa as the private key

exec('ls -lh', 'ubuntu@my-remote.com').pipe(process.stdout)

// or using the more settings

exec('ls -lh', {
  user: 'ubuntu',
  host: 'my-remote.com',
  key: myKeyFileOrBuffer,
  password: 'my-user-password'
}).pipe(process.stdout)

// or if you want to pipe some data to the remote process

process.stdin
  .pipe(exec('echo try typing something; cat -', 'ubuntu@my-remote.com'))
  .pipe(process.stdout)

Optionally there is a callback api as well

exec('ls -lh', 'ubuntu@my-remote.com', function (err, stdout, stderr) {
  console.log(err, stdout, stderr)
})

License

MIT

主要指標

概覽
名稱與所有者mafintosh/ssh-exec
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2013-11-20 18:44:24
推送於2020-06-21 01:21:53
最后一次提交2016-01-29 08:10:08
發布數18
最新版本名稱v2.0.0 (發布於 2016-01-20 20:53:37)
第一版名稱v0.1.0 (發布於 2013-11-20 18:53:32)
用户参与
星數126
關注者數5
派生數25
提交數52
已啟用問題?
問題數21
打開的問題數11
拉請求數3
打開的拉請求數3
關閉的拉請求數8
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?