I am using Putty to achieve SSH Reverse Tunnel Port Forwarding. Most of the tutorials are teaching me to forward remote port to localhost port. However, may I know is it make sense to input other host such as 192.168.1.132:8081
into the Destination field?
I have tried to do that. 192.168.1.132:8081
is a working web server with a contented page, but I got ERR_EMPTY_RESPONSE
when I visit localhost:12345
(I set port 12345
as the source port) from the client device.
My Putty Configurations
Outgoing Proxy configuration:
Tunneling config (the Dynamic
one is for the Socks5 connection, please just ignore it; the R12345
one is the tunnel that I am playing with):
The result that I try to access the tunnel from the Destination (SSH Server):
Can anyone help me?
UPDATE 1
In the device that I am running SSH command, I am going out with via a proxy server. Is that affecting the reverse tunnel behavior?
UPDATE 2
I have tried to make the reverse tunnel from the http server directly. However, in the SSH server I can visit the website by http://localhost:12345. Attched setting and result at below.
Same, http server needed to go out via my office's http proxy too!
Create a reverse tunnel from http server
And then I can visit the http server from SSH server via localhost:12345
192.168.1.132:8081
from the SSH client? (with no SSH involved in this case at all). Do you see proper page?192.168.1.132:8081
may ignore requests destined to addresses other than192.168.1.132
. When you connect from the remote side of your SSH connection, the address islocalhost:12345
and it doesn't fit. If the tunnel didn't work at all, you would getERR_CONNECTION_REFUSED
, notERR_EMPTY_RESPONSE
. TOOGAM's answer is right: in general you can build tunnels this way.