Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit bfe9c55

Browse files
ra00llepture
authored andcommitted
privateKey example (#83)
added a way to ssh-connect using private key / passphrase
1 parent 78a753b commit bfe9c55

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ client.scp({
9797
}, './', function(err) {})
9898
```
9999

100+
Login using private key:
101+
```js
102+
client.scp('file.txt', {
103+
host: 'example.com',
104+
username: 'admin',
105+
privateKey: require("fs").readFileSync('path/to/private/key'),
106+
passphrase: 'private_key_password',
107+
path: '/home/admin/'
108+
}, function(err) {})
109+
```
110+
100111
**TODO**: download via glob pattern.
101112

102113

0 commit comments

Comments
 (0)