Unix & Linux Asked by Mike Slinn on January 27, 2021
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):
$C9_TARGET_HOST
) using a (command line) terminal, and leaves the terminal open.
$C9_JUMP_HOST
) using a second (command line) terminal, and leaves the terminal open.
$C9_JUMP_PORT
) on the jump hostssh
connections from AWS Cloud9.
~/.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.
~/.ssh/authorized_hosts
. Add a new 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,ssh
$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?
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.
So what you want to to is to establish a reverse tunnel from the Target (private server) to the Jump Host (public server) so that you could establish a connection from AWS to Target, correct?
In that case, the reverse tunnel has to be built from the Target, so there you could invoke something like
ssh -f -N -R $JUMPER:$PORT:localhost:22 $USER@$JUMPER
Maybe you also want to try out "autossh" instead of "ssh", to keep your reverse tunnel open. The command uses an additional parameter for a monitor port:
autossh -M $MONITORPORT -f -N -R $JUMPER:$PORT:localhost:22 $USER@$JUMPER
If you use only the part $PORT:localhost:22, you have to go to the target in two steps:
Hope that helps, Georg
Answered by Georg Mach on January 27, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP