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

Added option which will try "keyboard-interactive" user authentication #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mashaalmemon
Copy link

Added ability to handle "keyboard-interactive" user authentication if primary authentication fails.

My use case for this feature is discussed in #31 . This works perfectly with user authentication when SSH server setup to use public key and multi-factor authentication. To try this out you can setup an SSH host on AWS as discussed in this article: https://www.middlewareinventory.com/blog/aws-mfa-ssh-ec2-setup/ and ssh to it.

Options for such a setup would be as simple as:

export const sshConfig:Options = {
    endHost: '<ssh_host>,
    username: '<ssh_user>',
    privateKey: fs.readFileSync('<private_key>'),
    tryKeyboardInteractive:true
}

If "keyboard-interactive" authentication is initiated by the server, prompts passed in by the server will be shown, and the library will wait for keyboard input from the user before proceeding.

Note that if is set to true but "keyboard-interactive" authentication is not initiated by the server, the option will do nothing.

The README.md file has been updated to include a description of the new tryKeyboardInteractive option (which was lifted from the ssh2 library's own documentation).

…ctive" user authentication if primary authentication method fails. Documentation updated to reflect this new option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant