SSH Proxy — Examples
Concrete SSH Proxy walkthroughs: a database tunnel, a local dev server, a SOCKS proxy, a jump host, an ~/.ssh/config entry and a systemd tunnel service.
Back to overview: SSH Proxy · Open the live tool: www.jpkc.com/tools/ssh-proxy/
This page shows SSH Proxy through concrete walkthroughs. Hosts, users and ports are examples — plug in your own values. How the individual fields and options work in detail is covered in the manual. Remember: the tool only builds the commands; you run them in your own terminal.
Example 1: Reach a remote database
Goal: reach a MySQL database that only listens locally on the server from your own machine.
- Select Local Forward.
- SSH Host =
db-server.example.com, SSH User =deploy, SSH Port =22. - In the Port Forwards table: Local Bind
127.0.0.1, Local Port3306, Remote Host127.0.0.1, Remote Port3306. - Leave Background and KeepAlive on, click Generate.
Result: a Bash script with an invocation like
ssh \
-L 127.0.0.1:3306:127.0.0.1:3306 \
-f \
-N \
-o ServerAliveInterval=60 \
-o ServerAliveCountMax=3 \
deploy@db-server.example.comAfter starting it, simply point your DB client at 127.0.0.1:3306 — as if the database were running locally. The explanation table breaks down every flag. If the port is already taken locally, the forward will clash; pick a free local port then, such as 13306.
Example 2: Expose your local dev server
Goal: make your locally running web server (localhost:3000) reachable from a remote server, e.g. for a webhook test.
- Select Remote Forward.
- SSH Host =
public.example.com, SSH User =tunnel. - Table: Remote Bind
0.0.0.0, Remote Port8080, Local Host127.0.0.1, Local Port3000. - Tick the GatewayPorts switch (you want the port reachable from outside).
- Generate.
Result: an ssh -R 0.0.0.0:8080:127.0.0.1:3000 invocation — plus a clear comment block reminding you that the SSH server needs GatewayPorts clientspecified in /etc/ssh/sshd_config and a restart afterwards. Without that server setting the tunnel binds only to the server's 127.0.0.1, not to 0.0.0.0.
Example 3: A SOCKS5 proxy to browse through a server
Goal: route your browser traffic through a remote server.
- Select Dynamic / SOCKS.
- SSH Host =
gateway.example.com, SSH User =me. - Bind Address
127.0.0.1, SOCKS Port1080. - Also tick Compression (slow link), Generate.
Result: ssh -D 127.0.0.1:1080 -f -N -C … me@gateway.example.com, along with ready test commands like curl --socks5-hostname 127.0.0.1:1080 https://ifconfig.me. Then configure your application to use the SOCKS5 proxy 127.0.0.1:1080 — conveniently via the Proxy Settings generator. Important: in Firefox set network.proxy.socks_remote_dns = true, otherwise DNS queries leak around the proxy.
Example 4: Reach the internal network through a bastion host
Goal: reach an internal server that's only accessible via a jump host.
- Select Jump Host, Mode = Modern (-J / ProxyJump).
- In the Jump Chain table: Host
bastion.example.com, Port22, Userjumpuser. - Final Destination Host =
internal.example.com, Destination User =admin. - Generate.
Result:
ssh \
-J jumpuser@bastion.example.com \
-o ServerAliveInterval=60 \
admin@internal.example.comNeed a second intermediate hop? Click Add Jump and add the row — -J takes multiple, comma-separated hops. On very old servers (before OpenSSH 7.3) choose Legacy (ProxyCommand) instead; for multiple hops the tool then emits chained ~/.ssh/config blocks.
Example 5: Bake a recurring tunnel into ~/.ssh/config
Goal: stop typing the long command every time and let ssh myserver suffice.
- Select SSH Config.
- Host Alias =
myserver, HostName =db-server.example.com, User =deploy. - IdentityFile =
~/.ssh/id_ed25519. - In the forward table: Type
L, Bind:Port127.0.0.1:3306, Target:Port127.0.0.1:3306. - Generate.
Result: a ready block to append to ~/.ssh/config:
Host myserver
HostName db-server.example.com
User deploy
IdentityFile ~/.ssh/id_ed25519
ServerAliveInterval 60
ServerAliveCountMax 3
ExitOnForwardFailure yes
LocalForward 127.0.0.1:3306 127.0.0.1:3306
# Usage: ssh myserverAfter that ssh myserver is enough, and the forward comes up automatically. Use Copy, then append it to your config.
Example 6: Run a tunnel as a systemd service at boot
Goal: keep a database tunnel running permanently as a service that comes back up by itself after a reboot.
- Select Autostart Setup, Autostart Method = systemd (Linux).
- SSH Host =
db-server.example.com, SSH User =deploy, Identity File =~/.ssh/id_ed25519. - Tunnel Type =
Local (-L), Forward Spec =3306:127.0.0.1:3306. - Service Name =
db-tunnel, Run as User = your username. - Generate.
Result: two tabs. tunnel.sh holds the start script; db-tunnel.service holds a systemd unit with Restart=always and RestartSec=10, plus the install instructions baked into the comments (sudo cp …, daemon-reload, enable --now). Copy the service tab to /etc/systemd/system/db-tunnel.service and enable it — the tunnel then survives reboots and drops. If you need several tunnels managed centrally, the Management Script generator is the better fit.
There's more on the individual generators in the manual, strategy and pitfalls in the tips & tricks. Get started directly in the tool.