Embed this tool on your site
<iframe src="https://devtoolbox.dedyn.io/tools/ssh-tunnel-builder" width="100%" height="900" frameborder="0" title="SSH Tunnel Command Builder"></iframe>

SSH Tunnel Command Builder

Build SSH tunnels for local port forwarding (-L), remote port forwarding (-R), or a SOCKS proxy (-D). Generate a ready-to-run command (with ProxyJump, keepalive options, and autossh) plus an optional ~/.ssh/config snippet.

Presets:

SSH Connection

Tip: You can enter host or user@host. For multi-hop, use ProxyJump.
Leave blank for the default (22).
Comma-separated for multiple hops: user@hop1,user@hop2.
When set, generates a ~/.ssh/config snippet.
If enabled, command starts with autossh -M 0.

Tunnel Type

Open a port on your machine and forward traffic through the SSH server to a destination.

Local Forwards (-L)

Use 127.0.0.1 to keep it local. Use 0.0.0.0 to allow LAN access.
In ssh_config this is GatewayPorts yes.

Options

Send keepalives every N seconds (0 disables).
Disconnect after N missed keepalives.

Generated Command

# Fill in the form to generate an SSH tunnel command

ssh_config Snippet (Optional)

# Enter a Host alias to generate a ~/.ssh/config snippet

Frequently Asked Questions

When should I use an SSH tunnel?
Use SSH tunnels to securely access services behind firewalls (databases, admin dashboards), to expose a local dev server through a remote host, or to route application traffic through a SOCKS proxy.
How do I connect to a forwarded port?
For local forwards (-L), connect your client to localhost:<local-port>. For dynamic forwards (-D), configure your browser/app to use a SOCKS5 proxy at localhost:<port>. For remote forwards (-R), connect to server:<remote-port> from the remote side.
Why does my remote forward not bind to 0.0.0.0?
Remote forwarding to a public bind address may be blocked by the SSH server configuration. The server's GatewayPorts option controls whether remote forwards can listen on non-loopback addresses. If you can't change the server config, keep the remote bind at 127.0.0.1 and access it from the server itself.
Should I use autossh?
For long-lived tunnels, autossh is a good idea because it restarts the tunnel when the connection drops. Pair it with keepalives (ServerAliveInterval/ServerAliveCountMax) and run it under systemd for reliability.