0

I am on an AWS box and want to connect to a production machine through my local computer. If I just wanted to connect from my local computer, I could connect as follows:

ssh -ND <port> prod-machine

How can I add an extra connection, mimicking the above, from AWS --> Local --> Production. Importantly, I can't connect direction from AWS --> Production. So should be some sort of two tunnel set up through my local machine, but not sure exactly how to do it... can you guys help out?

Thank you!

1
  • 2
    I think you're going to need to explain the hosts better (name them A B C or something) and explaining where you plan to ssh from and ssh to, and where you want your tunnel to connect from and connect to. It's confusing when you say "you're on AWS" and then talk about your local computer. Are you trying to get a backwards "dynamic" port forward? OpenSSH doesn't have that option as far as I know, but see superuser.com/a/370931/55979 for a workaround
    – DerfK
    Jan 14, 2017 at 0:51

1 Answer 1

0

Figured it out. This is what got it to work. Thanks to @DerfK for the link to a related thread.

ssh -fND 8891 [prod machine]
ssh -fNR 8891:localhost:8891 [aws box]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .