From 33e112800899fa8e1f3e4ea23b2e6d16985ae1f8 Mon Sep 17 00:00:00 2001 From: manish Date: Tue, 5 Aug 2014 15:36:03 +0530 Subject: [PATCH 1/2] support for ssh_options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit added support to pass ssh-options, the ones which are passed to scp through ‘-o’ command line flag. --- README.md | 46 +++++++++++++++++++++++++++++++++ package.json | 3 ++- scp.js | 53 ++++++++++++++++++++++++++------------- test/get-with-options.js | 20 +++++++++++++++ test/send-with-options.js | 21 ++++++++++++++++ 5 files changed, 125 insertions(+), 18 deletions(-) create mode 100644 test/get-with-options.js create mode 100644 test/send-with-options.js diff --git a/README.md b/README.md index 135dfa1..e55b354 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,30 @@ scp.send({ }); ```` +You can also pass, `ssh options`, the ones which should be passed to scp through `-o` command line option + +The code + +````javascript +scp.send({ + file : './file.txt', + user : 'username', + host : 'myServer', + port : 22, + path : '~', + ssh_options : { + ControlMaster : 'no', + StrictHostKeyChecking : 'yes' + } +```` + +is equivalent to following command line + +```` +scp -o ControlMaster=no -o StrictHostKeyChecking=yes -P 22 username@myServer:~/file.txt ~ +```` + + ###scp.get(options, cb) Transfer a file from a remote host (in your `~/.ssh/config`) to the current computer. @@ -65,6 +89,28 @@ scp.get({ }); ```` +You can also pass, `ssh options`, the ones which should be passed to scp through `-o` command line option. + +The code + +````javascript +scp.get({ + file : '~/file.txt', + user : 'username', + host : 'myServer', + port : 22, + path : '~', + ssh_options : { + ControlMaster : 'no', + StrictHostKeyChecking : 'yes' + } +```` +is equivalent to following command line + +```` +scp -o ControlMaster=no -o StrictHostKeyChecking=yes -P 22 username@myServer:~/file.txt ~ +```` + ## license (The MIT License) diff --git a/package.json b/package.json index 40f5c2e..13c31f7 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "Gabriel Preston ", "Joseph Silvestre ", "appr ", - "Daniel Phatthanan " + "Daniel Phatthanan ", + "Manish Gupta Date: Tue, 5 Aug 2014 15:38:33 +0530 Subject: [PATCH 2/2] bump version to 0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 13c31f7..1d23c23 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ ], "name": "scp", "description": "remote file copy wrapper", - "version": "0.0.4", + "version": "0.0.5", "repository": { "type": "git", "url": "git://github.com/ecto/node-scp.git"