MarketSquare / MarketSquare/SSHLibrary

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

Open
#440 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
167
Forks
145
PR merge metrics
No merged PRs in 30d

Description

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 ssh@dut.com`
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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SSHLibrary implementation of Open Connection and the existing Write and Read flow. Reproduce the Laptop → jump server → DUT setup, including more than one jump server if possible, and compare it with the tunnel approach. Done means Open Connection can reach the DUT through the intermediate host while retaining the library’s normal keywords and reliable automated execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.