Ssh – How to configure ssh tunneling past a firewall

puttysshssh-tunneling

I have a NAS running Linux behind a firewall at home. I want to access it remotely using a few services such as a Transmission GUI (port 9091) and webmin (port 10000), but through an SSH tunnel on port 22.

For simplicity, I wanted to leave as many net-facing ports closed and only opened up port 22 to the NAS.

I tried configuring tunnelling in PuTTY (local port 10000, remote.ip.address:10000), but I believe I'm still hitting a firewall rule after a successful SSH login. Is this the correct use of SSH tunnelling?

Best Answer

You don't need to open tunneled ports on the firewall. You are fine opening only the SSH port.

You may be getting caught by one of a few problems.

  • The local ports may already be in use. Try using netstat to see if the port is occupied.
  • When you connect to the tunneled port you will find it a localhost (127.0.0.1) not the remote address. Some software may not like this.
  • Tunneling can be turned off in the server. In that case your tunnels won't work.
  • If you are tunneling to another host (remote.ip.address is not on the host you are tunneling through), you may be blocked by the SSH server's AllowTcpForwarding setting.
  • If you are tunneling to a port on the same host (remote.ip.address is 127.0.0.1, or some other IP on the server) you are tunneling to the destination software may not like it. For example, some VNC servers default to preventing same host connections to prevent looping conditions.

Try connecting with the debug flag enabled.

Related Question