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 acceptssh
connections 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 new
host
block to ~/.ssh/config
that makes it easier to define a reverse ssh port forwarding tunnel from
the target server to the jump host.
-
Add the Cloud9 ssh key to
~/.ssh/authorized_hosts
.host
block to ~/.ssh/config
that makes it easier to forward ssh
commands
from Cloud9 to the target server.
ssh
port 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 forward ssh
commands 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_HOSTI wonder if the `-T` option might be helpful? Should `nohup` be used?
nohup
is used when creating the tunnel so it remains in place once the administrator logs off.
I would be happy to provide credit in the blog posting to whomever might provide the solution.