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

Connect via ssh to a remote machine from an intermediate (jump host) machine #440

Open
kishankarun opened this issue Jul 6, 2024 · 0 comments

Comments

@kishankarun
Copy link

The current SSH Library supports connecting to a remote machine and execute commands.

In a case where there is a "jump" server which only has a connection to my actual targeted machine (Device Under Test [DUT]),

Development Machine (Laptop) ---> Jump Server (jumpserver.com) ---> DUT (dut.com)

This could be approached now in 2 tedious ways:

  1. Open Connection | jumpserver.com
    1.1. Write [email protected]
    1.2. Wait for password prompt and address it (check for prompt, provide password etc)
    1.3. Keep using the combination of Write and Read for the commands to be executed (Write whoami, $result=Read 2s)

  2. Create a tunnel through jump server to the DUT and keep it running in the background (which will simulate a direct connection)
    2.1. Connect to the tunnel and proceed to work as if the Laptop is connected directly to DUT

  • The first approach is too tedious as we don't get to leverage all the keywords provided by SSHLibrary, as it is dependent only on Write and Read
  • The second approach has a dependency on the created tunnel, and if the tunnel is broken, the tests start failing (especially challenging when run with automation tools like Jenkins)

Would it be possible to provide a 2 level Open Connection
or a support for "nested" Open Connection, just in case there are more than one jump servers

Is there any alternate way to approach this situation?

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

No branches or pull requests

1 participant