File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ var options = {
17
17
file: ' dump.sql'
18
18
user: ' username' ,
19
19
host: ' myServer' ,
20
+ port: ' 22' ,
20
21
path: ' ~'
21
22
}
22
23
@@ -41,6 +42,7 @@ scp.send({
41
42
file: ' ./file.txt' , // local file to send
42
43
user: ' username' , // username to authenticate as on remote system
43
44
host: ' myServer' , // remote host to copy to, set up in your ~/.ssh/config
45
+ port: ' 22' , // remote port, optional, defaults to '22'
44
46
path: ' ~' // remote path to save to (this would result in a ~/file.txt on myServer)
45
47
});
46
48
````
@@ -58,6 +60,7 @@ scp.get({
58
60
file: ' ~/file.txt' , // remote file to grab
59
61
user: ' username' , // username to authenticate as on remote system
60
62
host: ' myServer' , // remote host to transfer from, set up in your ~/.ssh/config
63
+ port: ' 22' , // remote port, optional, defaults to '22'
61
64
path: ' ~' // local path to save to (this would result in a ~/file.txt on the local machine)
62
65
});
63
66
````
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ scp.send = function (options, cb) {
13
13
var command = [
14
14
'scp' ,
15
15
'-r' ,
16
+ '-P' ,
17
+ ( options . port == undefined ? '22' : options . port )
16
18
options . file ,
17
19
( options . user == undefined ? '' : options . user + '@' ) + options . host + ':' + options . path ,
18
20
] ;
You can’t perform that action at this time.
0 commit comments