SSH Tunnels and Forwarding Cheat Sheet/Clear configured forwards on command line

Override config-defined forwards for one invocation.

Section: Tunnel Recipes

Clear configured forwards on command line

bash
bash
ssh -o ClearAllForwardings=yes user@example.com
Explanation

Override config-defined forwards for one invocation.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Tunnel Recipes
PostgreSQL tunnel
Access a private PostgreSQL instance through a bastion.
OpenIn sheetbashsame section
MySQL tunnel
Access a private MySQL instance through a bastion.
OpenIn sheetbashsame section
Tunnel to Kubernetes API
Access a private API server locally.
OpenIn sheetbashsame section
Tunnel via jump host
Create a local forward through a ProxyJump bastion.
OpenIn sheetbashsame section
Create a local port forward
Forward a local port to a remote host and port.
OpenIn sheetbash1 tag match
Create a remote port forward
Expose a local service on the remote host.
OpenIn sheetbash1 tag match