Skip to content

Did you know?

PuTTY can add or remove SSH tunnels without reconnecting.

Right-click the title bar, choose Change Settings, edit Connection > SSH > Tunnels and click Apply.

  • Windows
  • Last checked

Explained

Forgot a tunnel when you opened a PuTTY session? You don’t have to disconnect. Right-click the PuTTY title bar, choose Change Settings, open Connection > SSH > Tunnels, add the forwarding and click Apply. The new port starts working straight away in the same session.

For example, to reach a PostgreSQL server that only listens on the server’s localhost, add source port 5050 with destination 127.0.0.1:5432, click Add and then Apply. Your database client can now connect to localhost:5050 on your PC.

Removing works the same way. When you remove a local or dynamic (SOCKS) tunnel, PuTTY stops listening on that port immediately. A removed remote tunnel may stay open on the server, but PuTTY refuses any connection that arrives on it.

Changes made this way only last for the current session. To keep them, load the saved session in the PuTTY configuration window, add the tunnels there and click Save. PuTTY can also start tunnels from the command line: plink -N -L 5050:127.0.0.1:5432 user@server opens just the tunnel without a shell.

Learn more

← All tech tips · Suggest a fix

Back to top