WindTerm Port Forwarding and SSH Tunnels Explained

A clear explanation of SSH tunnels in WindTerm, with practical examples of local, remote and dynamic forwarding and the security points to remember.

WindTerm Port Forwarding and SSH Tunnels Explained

WindTerm supports SSH port forwarding in all three of its common forms: local, remote and dynamic. Tunnels are one of the most useful and least understood features of SSH. They let you reach services that are not exposed to the internet, such as a database listening only on a server's loopback interface or an administration dashboard on a private network, without opening firewall ports or setting up a full virtual private network.

This guide explains what each type of tunnel does, how to think about the ports involved, typical situations where each is useful, and the security considerations that should guide when and how you use them.

What SSH port forwarding does

An SSH connection is an encrypted channel between your computer and a server. Port forwarding carries other network traffic through that channel. Instead of connecting directly to a service, your application connects to a port that SSH manages, and SSH carries the traffic across the encrypted connection to the destination.

The result is that a service which can only be reached from inside a network becomes reachable from your computer, as long as you can open an SSH session to a machine inside that network. Because the traffic travels inside SSH, it is encrypted on the way, even if the underlying service does not encrypt its own traffic.

Local port forwarding

Local forwarding is the most common type. You choose a port on your own computer, and SSH forwards connections arriving there to a host and port reachable from the server.

Imagine a database server that listens only on its loopback interface for security reasons. You cannot connect to it from your laptop directly. With local forwarding, you might forward a port on your laptop to the database's port on the server's loopback interface. Your database client then connects to your own computer on the chosen port, and the traffic arrives at the database as though it came from the server itself.

The same approach works for web dashboards on private networks, internal APIs and any other service that the SSH server can reach but you cannot.

Remote port forwarding

Remote forwarding works in the opposite direction. You choose a port on the remote server, and connections arriving there are forwarded back through the SSH connection to a host and port reachable from your computer.

This is useful when something on the server side needs to reach a service running on your machine. A developer might expose a local development server temporarily so that a colleague on the remote network can test it, or allow a remote system to reach a service that only exists on a local network. Remote forwarding should be used sparingly, because it opens a path from the server back towards your environment.

Dynamic port forwarding

Dynamic forwarding creates a SOCKS proxy on your computer. Instead of forwarding a single port to a single destination, applications configured to use the proxy can reach many destinations through the SSH server, with the destination chosen for each connection.

This is convenient when you need to browse several internal web interfaces through a bastion host. You configure your browser, or a particular browser profile, to use the SOCKS proxy, and internal addresses become reachable as though you were inside the network. Remember that only applications configured to use the proxy send their traffic through it.

Setting up tunnels in WindTerm

WindTerm manages tunnels as part of a session's SSH configuration. The developer's documentation describes support for direct or local forwarding, reverse or remote forwarding, and dynamic forwarding, and an introductory video on the project's companion site demonstrates the process. Recent versions also provide a tunnels view in the main window for quick access to active tunnels.

The general approach is consistent across tunnel types. Open the session's settings, find the tunnel or port forwarding configuration, choose the type of tunnel, then specify the listening port and, for local and remote tunnels, the destination host and port. Save the session, connect, and the tunnel becomes active while the session remains open.

Choosing ports sensibly

A few conventions make tunnels easier to manage.

  • Use a local port above 1024 so that administrator privileges are not required to listen on it.
  • Avoid ports already used by services on your computer, otherwise the tunnel will fail to start.
  • Pick memorable port numbers for regular tunnels, for example a number that echoes the service's real port.
  • Bind local tunnels to the loopback address rather than all interfaces, so other machines on your network cannot use them.

Practical examples

Several everyday situations benefit from tunnels.

A developer who needs to inspect a production database can use a local tunnel through a bastion host, keeping the database closed to the internet while still allowing a graphical client to connect. A system administrator who manages servers with web-based control panels on a private network can use dynamic forwarding to reach all of them through a single SSH session. A team testing a new service can use a temporary remote tunnel to let colleagues on a remote network try it before it is deployed properly.

In each case, the tunnel lives only as long as the session, which keeps the exposure limited and easy to reason about.

Combining tunnels with jump hosts

Tunnels work well with WindTerm's support for ProxyCommand, ProxyJump and jump server proxies. You can connect to an internal server through a bastion, then create a local tunnel from that internal server to a service it can reach. The traffic travels through both hops while remaining encrypted, and you only need to configure the chain once in the session settings.

Security considerations

Tunnels are powerful, which is precisely why they deserve care.

  • Only create tunnels you understand, and close them when you no longer need them.
  • Check whether your organisation permits tunnelling, as some security policies restrict it.
  • Prefer local and dynamic forwarding over remote forwarding unless you specifically need the reverse direction.
  • Bind listening ports to loopback addresses to prevent other devices from using your tunnel.
  • Remember that a tunnel extends the trust of the SSH session, so protect your credentials accordingly.

Troubleshooting tunnels

When a tunnel does not work, a few checks resolve most problems. If the tunnel fails to start, another application may already be using the local port. If the tunnel starts but connections fail, confirm that the destination host and port are reachable from the SSH server, not merely from your computer. If remote forwarding does not accept connections from other machines, the server's SSH configuration may restrict remote binding. Finally, confirm that the server permits forwarding at all, as administrators can disable it.

A worked example with a database

Consider a PostgreSQL server that listens only on its loopback interface on port 5432, running on a machine you can reach over SSH. In WindTerm, you would add a local tunnel to that session, choosing a free port on your computer, perhaps 15432, and setting the destination to the loopback address on port 5432 as seen from the server.

Once the session connects, your database client connects to the loopback address on your own computer at port 15432. From the database's perspective, the connection arrives locally from the server, so it is accepted under the server's local access rules. When you close the session, the tunnel disappears, and the database is once again completely unreachable from outside.

The same pattern applies to MySQL, Redis, Elasticsearch, internal web dashboards and administrative interfaces. Only the port numbers change.

Documenting your tunnels

Tunnels are easy to create and easy to forget. If several people share responsibility for a set of servers, record which tunnels exist, which ports they use and why they are needed. A short note in your team's documentation prevents confusion when someone finds an unfamiliar port in use, and it makes reviews of access arrangements far simpler. Within WindTerm, clear session labels and groups serve a similar purpose for your own work.

Tunnels and X11 forwarding

X11 forwarding is a specialised relative of port forwarding. Rather than carrying an arbitrary port, it carries the X Window System protocol, so graphical programs on the server can display their windows on your desktop. WindTerm supports X11 forwarding, which is occasionally useful for graphical configuration tools on Linux servers, although it generally feels slower than a modern remote desktop over long distances.

Checking that a tunnel is listening

When a tunnel seems to start but your application cannot connect, confirm that the local port is actually listening. On Windows, the netstat command with the appropriate options lists listening ports, while on macOS and Linux the lsof or ss commands serve the same purpose. Seeing the expected port in the list tells you the tunnel is ready, which narrows any remaining problem to the destination side of the connection.

Frequently Asked Questions

What types of port forwarding does WindTerm support?

It supports local, remote and dynamic forwarding, the three standard forms of SSH tunnelling.

Do tunnels stay open after I close the session?

No. Tunnels depend on the SSH session and close when it ends.

Why does my local tunnel fail to start?

The chosen local port is probably in use by another application. Choose a different port and try again.

Is dynamic forwarding the same as a VPN?

Not quite. It provides a SOCKS proxy that only configured applications use, whereas a VPN usually routes traffic at the system level.

Can I use tunnels through a bastion host?

Yes. Combine tunnels with ProxyJump or a jump server configuration to reach services behind a bastion.

Can several tunnels share one session?

Yes. A single SSH session can carry multiple tunnels, for example one for a database and another for a dashboard, as long as each uses its own local port.

Does port forwarding work through a proxy?

Yes. Tunnels travel inside the SSH connection, so if the session itself reaches the server through an HTTP, SOCKS5 or jump server proxy, the tunnels follow the same route.

Conclusion

WindTerm port forwarding turns an ordinary SSH session into a secure path to services that would otherwise be out of reach. Use local forwarding for databases and dashboards, dynamic forwarding for browsing several internal sites, and remote forwarding only when the reverse direction is genuinely required. Choose ports thoughtfully, bind to loopback addresses, close tunnels when finished and respect your organisation's policies, and tunnels will become one of the most valuable tools in your workspace.