Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sperka/node-sshclient
ssh/scp client library for node.js
https://github.com/sperka/node-sshclient
Last synced: 3 months ago
JSON representation
ssh/scp client library for node.js
- Host: GitHub
- URL: https://github.com/sperka/node-sshclient
- Owner: sperka
- License: mit
- Created: 2012-05-31T23:38:05.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-04-06T20:18:01.000Z (almost 8 years ago)
- Last Synced: 2024-09-25T16:54:29.743Z (4 months ago)
- Language: JavaScript
- Size: 180 KB
- Stars: 17
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-baas - sshclient
README
_sshclient_ is a lightweight ssh/scp library for [node](http://nodejs.org).
_sshclient_ doesn't support interactivity, so you need to set up your remote server to allow login without a password
(google: 'ssh login without a password').## Example
### ssh
var ssh = new SSH({
hostname: 'server'
, user: 'user'
, port: 22
});ssh.command('echo', 'test', function(procResult) {
console.log(procResult.stdout);
});
### scpvar scp = new SCP({
hostname: 'server'
, user: 'user'
});
scp.upload('myfile', 'path/to/remote/dir/', function(procResult) {
console.log(procResult.exitCode);
});
scp.download('remotefile', 'path/to/local/dir/', function(procResult) {
console.log(procResult.exitCode);
});For more examples, see the tests.
## Installation
$ npm install node-sshclient
## Running tests
To run tests, simply enter:
$ npm test
(note that in mocha.opts --timeout is set to 25seconds to test connect fail - you may want to change it depending on your test system).
_Note_: set the `hostname` variable to your server's hostname to succeed with the tests (or add `testhostname` to
`~/.ssh/config` with the proper settings).