This has been asked before but I've had no success. I'm trying to connect two Linux devices via an E2C as a jump host:
[Box2 (Accessing REST API)] --> [EC2] --> [Box1 (Hosting REST API)]
What I've done:
On Box1 open up a reverse tunnel from port 6345 to port 7345 on E2C:
ssh -R 7345:localhost:6345 -i e2c_cert.pem [email protected]
On Box2 forward local 6345 port to port 7345 on E2C:
ssh -L localhost:6345:xx.xx.xx.xx:7345 -i e2c_cert.pem [email protected]
On the E2C port 7345 has been opened.
On the E2C I can see a response on Box1 when:
wget localhost:7345
But I get a connection refused on Box2 when trying:
wget localhost:6345
What am I doing wrong?
ssh -R
makes the SSH server listen on the loopback interface only. What if you change yourssh -L
command tossh -L localhost:6345:localhost:7345 …
?ssh -R
command. I asked you to change thessh -L
command and only thessh -L
command.