0

On my local machine (behind NAT), if I visit 192.168.154.129:80 I see my web server.

My remote machine has IP 151.xx.xxx.xxx.

I would like that all the web traffic that goes to 151.xx.xxx.xxx:1025 should see what I see at 192.168.154.129:80 from my local web server.

So, I've set up a reverse SSH tunnel as described here: https://serverfault.com/questions/321132/how-to-start-a-reverse-tunnel-with-putty

... and then login and connect.

Yet, if I browse 151.xx.xxx.xxx:1025 the connection returns ERR_CONNECTION_TIMED_OUT. Why?

151.xx.xxx.xxx:80 correctly hosts a remote web server, and I also have another one on port 8112, without any set-up. I doubt port 1025 is closed: I remember doing this with the cli pretty easily (no need to open ports or firewalls).

I think something's wrong with my PuTTY configuration but have no idea what.

2019-04-10 13:52:08 Connecting to 151.----- port 22
2019-04-10 13:52:08 We claim version: SSH-2.0-PuTTY_Release_0.70
2019-04-10 13:52:08 Server version: SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.12
2019-04-10 13:52:08 We believe remote version has SSH-2 channel request bug
2019-04-10 13:52:08 Using SSH protocol version 2
2019-04-10 13:52:08 Doing ECDH key exchange with curve Curve25519 and hash SHA-256
2019-04-10 13:52:08 Server also has ssh-ed25519/ecdsa-sha2-nistp256/ssh-dss host keys, but we don't know any of them
2019-04-10 13:52:08 Host key fingerprint is:
2019-04-10 13:52:08 ssh-rsa 2048 -----
2019-04-10 13:52:08 Initialised AES-256 SDCTR client->server encryption
2019-04-10 13:52:08 Initialised HMAC-SHA-256 client->server MAC algorithm
2019-04-10 13:52:08 Initialised AES-256 SDCTR server->client encryption
2019-04-10 13:52:08 Initialised HMAC-SHA-256 server->client MAC algorithm
2019-04-10 13:52:12 Sent password
2019-04-10 13:52:12 Access granted
2019-04-10 13:52:12 Opening session as main channel
2019-04-10 13:52:13 Opened main channel
2019-04-10 13:52:13 Requesting remote port 1025 forward to 192.168.154.129:80
2019-04-10 13:52:13 Remote port forwarding from 1025 enabled
2019-04-10 13:52:13 Allocated pty (ospeed 38400bps, ispeed 38400bps)
2019-04-10 13:52:13 Started a shell/command

enter image description here

EDIT: also tried this

ssh -R 151.xxx.xxx.xxx:1025:127.0.0.1:80 root@151.xxx.xxx.xxx

No PuTTY, straight from the local VM. Still won't work.

EDIT: tried with a different port, 8113.

This works, as it redirects me to 192.168.154.129. However it is an actual redirect, which means it won't work from outside my network.

2019-04-10 14:30:51 Received remote port :8113 open request from 37.xxx:34502
2019-04-10 14:30:51 Attempting to forward remote port to 192.168.154.129:80
2019-04-10 14:30:51 Forwarded port opened successfully
2019-04-10 14:30:53 Forwarded port closed
1

I think the firewall on your remote server is blocking your attempts to access the webserver on port 1025.

The reverse tunnel is getting set up, but browsers are getting rejected by the firewall.

Unblock the port after you make the tunnel and see if you can access your local webserver from the remote server.

  • iptables -L shows no rules, same goes for the firewall from the remote machine control panel – Saturnix Apr 10 at 12:09
  • So your server has no firewall? – Guy Gastineau Apr 10 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.