Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add useKeyboardInteractive option #74

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ If this option is not set, gulp-sftp assumes the user is using private key authe

If you intend to use anonymous login, use the value '@anonymous'.

#### options.useKeyboardInteractive

type `bool`
Default: `false`

Use keyboard-interactive user authentication(if primary user authentication method fails, you can try to set this `true`).

#### options.remotePath

Type: `String`
Expand Down
16 changes: 14 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ module.exports = function (options) {

});


/*
* connection options, may be a key
*/
Expand All @@ -180,7 +179,20 @@ module.exports = function (options) {
};

if(options.password){
connection_options.password = options.password;
if (!options.useKeyboardInteractive) {
connection_options.password = options.password;
} else {
connection_options.tryKeyboard = true;
c.on('keyboard-interactive', function(
name,
instructions,
instructionsLang,
prompts,
finish
) {
finish([options.password]);
});
}
}else if(options.agent) {
connection_options.agent = options.agent;
connection_options.agentForward = options.agentForward || false;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp-sftp",
"version": "0.1.5",
"version": "0.1.6",
"description": "Upload files via SSH",
"license": "MIT",
"repository": "gtg092x/gulp-sftp",
Expand Down Expand Up @@ -45,7 +45,7 @@
"gulp-util": "~3.0.0",
"object-assign": "~0.3.1",
"parents": "~1.0.0",
"ssh2": "~0.3.3",
"ssh2": "~0.5.5",
"through2": "~0.4.2"
},
"devDependencies": {}
Expand Down