
This means we are connecting to port 5901 on host B in this example.
Source port: this is the same as the other configuration.
On host C, open an ssh session to host B (this should be the same host B you connected to earlier):. The next step is to create a new tunnel from host C to host B and connecting the two tunnels together. Note that this port is not open to the internet, its only listening on host B localhost interface. Host B is now listening internally on port 5901 for connections to tunnel back to host A port 5900. So we now have the host we need to get to (A) connected to our SSH server (B). Second tunnel - Host C (your laptop somewhere else). For “seconds between keepalives” put it to 30, also check the “TCP keepalives” box. If you want this tunnel to always stay running (assuming your connection doesn’t go down), then enable some keepalives on the connection tab of putty. Your host will now connect, once it does the tunnel to host B is now open. Remote: this is a remote tunnel which means reverse in our scenario. Localhost is needed so the tunnel with end with machine A. This is the port your application is running on, so for us its VNC which is port 5900. I like to use different port numbers to keep it clear, but you can use the same port number in this entire example if you so choose.ĭestination: this is the port that will be tunneled into on machine A. You will use this later down the road so remember it. Source port: this is the port that is created on host B. The important part in the tunnel configuration is source and destination ports. Click down to the SSH drop down on the left, and go into the tunnel configuration:. Setup putty to SSH from host A to host B. In this example, I will have a VNC Server running on host A that I want to get to with me using host C. Otherwise there will be two putty SSH connections, A to B, then C to B.
This way you can reverse tunnel directly from B to A.
Vnc ssh tunnel putty Pc#
If your PC is directly accessible by device A (as in your device is is running an SSH server) then you can be the tunnel endpoint. Typically this is a linux SSH server on the internet.Ĭ: This is your device, you can be device B if you want, which will skip a step. Here is a picture so we can talk to what that means:Ī: The device you are trying to connect to, this is behind some device blocking access like a firewall, proxy, NAT, etc.ī: This is the device that A will tunnel to. Since you can’t make a direct connection to it (say you want to VNC, RDP, SSH to it, etc), a tunnel is the best way to poke a hole. A typical scenario is the device you need access to is behind a firewall or proxy. Great question! A reverse tunnel is needed when you are trying to connect to a client computer from an outside connection. I see a hundred different guides online but none of them really document the easy way to setup a reverse tunnel.