-
Notifications
You must be signed in to change notification settings - Fork 195
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
Whether to support keyboard-interactive parameters? #327
Comments
I'm really not clear about what your trying to do here or what problem
your running into. I also don't understand what that image is supposed
to be telling me or even how your using ssh2-sftp-client and therefore,
cannot provide any real guidance.
It sounds like your using the ssh2 module to create a 'tunnel' which
goes from your client, to the bastion host and then to the internal sftp
server and then trying to use ssh2-sftp-client to transfer files through
that tunnel? If that is the case, I would treat the two problems as
independent separate problems rather than one big problem.
The first thing I would do is use openssh's ssh and sftp CLI programs to
verify your assumptions regarding the bastion host and appropriate
levels of access. Manually establish the connections and necessary
tunnels using openssh CLI programs and verify your able to transfer
files. This will confirm any assumptions you have concerning ports,
permissions, firewalls etc. Note that there are many different
architectures for a 'bastion' host. It may also be worthwhile speaking
to the sys admins of the bastion host and telling them what it is you
want to do (at a high level) as there are likely things they can do on
the bastion host to make what your doing easier and more secure. For
example, if what your doing represents a legitimate business
requirement, they may simply make a port available which automatically
tunnels sftp connections to the internal sftp server rather than
requiring you to tunnel in over ssh. This would also be a more reliable
and efficient solution.
If you have no alternative other than the ssh tunnel with sftp run
inside that tunnerl, I would first write a script using ssh2 which
establishes the tunnel and then use openssh's sftp CLI to transfer files
over that tunnel to verify your tunnel works. I would then write a
ssh2-sftp-client program to do the same and verify that works. Finally,
you can then combine the two into a single script.
A key point to note is that ssh2 is an event based library while
ssh2-sftp-client is a Promise based library. Personally, if your going
to write part of the code using ssh2, I would consider writing the whole
solution using ssh2 rather than ssh2 and ssh2-sftp-client. This is
likely to be cleaner and easier to do. The benefit of ssh2-sftp-client
is that it provides a convenient Promise based API wrapper around the
sftp layer of ssh2 that makes working with a basic sftp server
straight-forward/easy. However, once you start something more complex
and need to use more of ssh2's API, your often just better off using
just ssh2, adopting an event driven model and keeping everything at that
level.
If I have completely misunderstood what your trying to do, you will need
to provide a more detailed description and possibly access to some
source code, before I can provide any guidance. Even then I may not be
able to help as your trying something I've not tried and for an
architecture I don't have access to.
Lee-42 ***@***.***> writes:
… image
I use the keyboard-interactive event implemented by the ssh2 module to connect to the remote bastion machine, but I use your module to do file
operations, but it seems that there is no connection to the bastion machine, or I have some APIs that are ignored
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
--
Tim Cross
|
I read your source code a bit, you did not handle the'keyboard-interactive' event, so my needs may not be fulfilled Is it possible to expand like this Prompts are some authentication parameters that you need to fill in, and then hand them over to the finish function, which is provided by ssh2 Regardless of the authentication method, you don’t seem to be involved in this piece of content now. I also tried node-ssh, which is also a library that encapsulates ssh2 as a Promise method. It implements simple handling of'keyboard-interactive' events, but I still like to use your library because the API you provide is better Use and reliable |
You can add any event listener you want with the on() method, so you
should be able to setup keyboard interaction listeners that will gather
the information. You will also need to set the tryKeyboard property to
true in the connect config object.
|
I use the keyboard-interactive event implemented by the ssh2 module to connect to the remote bastion machine, but I use your module to do file operations, but it seems that there is no connection to the bastion machine, or I have some APIs that are ignored
The text was updated successfully, but these errors were encountered: