I am trying to figure out how to get a jump host to work with AWS Cloud9. Below is a diagram taken from the blog post (on my staging server) there I am writing on the subject. Please refer to the blog post (just under 3000 words) for the entire scenario.

Here is the 4-party initialization sequence performed by an administrator using the client (laptop):
-
The administrator logs into the target server (
$C9_TARGET_HOST) using a (command line) terminal, and leaves the terminal open. -
The administrator logs into the jump host (
$C9_JUMP_HOST) using a second (command line) terminal, and leaves the terminal open. -
An administrator opens a port (
$C9_JUMP_PORT) on the jump host to acceptsshconnections from AWS Cloud9. - The administrator points a web browser at the Cloud9 web console to begin defining a Cloud9 environment.
- Once the administrator reaches the web page where the Cloud9 ssh key is available, they copy it to the clipboard.
-
The administrator uses the open terminal connected to the target server to:
-
Add the Cloud9 ssh key to
~/.ssh/authorized_hosts. Add a newhostblock to~/.ssh/configthat makes it easier to define a reverse ssh port forwarding tunnel from the target server to the jump host. - The administrator uses the open terminal connected to the jump host to:
-
Add the Cloud9 ssh key to
~/.ssh/authorized_hosts. Add a newhostblock to~/.ssh/configthat makes it easier to forwardsshcommands from Cloud9 to the target server. -
The administrator defines a reverse
sshport forwarding tunnel from the target server to the jump host, which means that the jump host will connect back to the target server via the tunnel and forwardsshcommands when a connection is made to the specified port ($C9_JUMP_PORT) on the jump host.ssh -fNR \ $C9_JUMP_HOST:$C9_JUMP_PORT:localhost:22 $C9_JUMP_USER@$C9_JUMP_HOST
I wonder if the `-T` option might be helpful? Should `nohup` be used? -
The administrator creates a reverse port forwarded tunnel using the definition they just created.
nohupis used when creating the tunnel so it remains in place once the administrator logs off. - After defining the jump host in the Cloud9 web console, the administrator presses the Next step button.
- Cloud9 attempts to reach the jump host.
- Cloud9 attempts to reach the target server via the jump host.
- If successful, Cloud9 advances the administrator's web page to the next step.
- The administrator clicks on each Next step button that appears until the Cloud9 environment is defined.
I would be happy to provide credit in the blog posting to whomever might provide the solution.