Documentation
Port forwarding
Each host keeps its own rules in the host editor, under Port Forwarding. Rules are part of the host. They sync, back up, restore, and duplicate with it. They are not inherited from a group. A host can have at most 64 rules.
Three kinds
| Rule | Same idea as | What it does |
|---|---|---|
| Local | ssh -L | Listens on this computer and connects to an address from the server. |
| Remote | ssh -R | Listens on the server and connects to an address on this computer. |
| SOCKS | ssh -D | A SOCKS proxy on this computer. SOCKS 4, 4a, and 5. The server resolves names. |
A rule has a listen address and port, a destination for local and remote rules, an optional label, and Start with the connection.
The listen address defaults to loopback: 127.0.0.1 and ::1 on this computer, localhost on the server. Any other address, or *, is shown with a warning.
Starting a rule
- Rules marked Start with the connection start when a terminal tab to that host connects, after the shell opens.
- Port Forwarding… on the tab’s context menu starts and stops any rule of that saved host.
- Open Tunnel on the host’s context menu connects with no terminal, as
ssh -Ndoes. It starts the rules marked Start with the connection, or all of them if none is marked. - Start Forward starts one rule. If the window already has a tunnel tab for the host, both actions use that tab.
A rule runs in one tab of the app at a time. A tab that is forwarding shows after its title. A host with rules shows the same mark in the list.
Forwards live in the tab. Closing the tab or the window, or quitting, stops them. When the shell of a terminal tab exits, its connection and forwards end too, even if forwarded connections are still open. A tunnel tab keeps forwards without a shell. Editing a running rule applies the next time it starts.
After an automatic reconnect, rules that were running start again. Rules you stopped, and rules that failed, stay stopped.
What import keeps
Import from ~/.ssh turns LocalForward, RemoteForward, and DynamicForward into rules, including GatewayPorts and ClearAllForwardings the way OpenSSH does. Unix sockets, a RemoteForward with no destination, port 0, and ${VAR} are not started. They stay in the host notes. Termius forward rules are not imported.