Skip to main content
Port forwarding sends network traffic through an SSH connection. Open Port Forwarding in the sidebar to create saved rules, start and stop them, and see how many connections each one is carrying.
Port Forwarding list with a running local rule and an idle dynamic SOCKS5 rule

A running local rule with one connection, and a stopped SOCKS5 rule.

Rule types

A rule always goes through a saved host (the SSH Host), using that host’s stored credentials. You don’t need an open terminal tab: YourSSH connects to the host on its own, and through its connection chain if it has one.

Create a rule

1

Open the editor

Go to Port Forwarding and click New rule. The New Port Forward Rule panel opens on the right.
2

Name the rule and pick a type

Enter a Label, then choose the Type: Local, Remote or Dynamic SOCKS5.
Type dropdown with Local, Remote and Dynamic SOCKS5

The type menu.

3

Set the addresses

Fill in Local Host and Port (the address that listens on your machine). For Local and Remote rules, also fill in Remote Host and Port for the destination. A Dynamic SOCKS5 rule needs only the local address, so the remote fields disappear.
4

Choose the SSH host

Pick the SSH Host the tunnel runs through. The field is marked optional so you can save a draft, but a rule without a host can’t start. It reports Select an SSH host first.
5

Optionally auto-start

Tick Auto-start on launch to bring the tunnel up each time YourSSH starts.
6

Save

Click Add Rule.
New Port Forward Rule panel with a local rule filled in

A local rule filled in: localhost port 2200 to port 22 on the remote side, through Demo Server.

New Port Forward Rule panel with Dynamic SOCKS5 selected

A dynamic SOCKS5 rule has no remote host or port.

Validation

The editor checks the form when you save:
  • Label, Local Host and, for local and remote rules, Remote Host can’t be empty. A missing value shows Required.
  • Each Port must be a number from 1 to 65535. Anything else shows 1–65535 under the field.
Port field highlighted in red with the message 1–65535

A port of 70000 is rejected.

Start and stop

Each rule has a button on the right: the play button starts it and the stop button stops it. Several tunnels can run at once, and each one is independent. The status dot on the left shows the state: An active rule shows a live connection count such as 1 conn. If a rule fails to start, check the message under it. Common causes are a local port already in use, no SSH host selected, or the host no longer existing.

Auto-reconnect

If the SSH connection drops while a tunnel is running, the rule switches to reconnecting… and YourSSH reconnects with exponential backoff, starting at 2 seconds and doubling up to 30 seconds. Local listeners stay bound while it retries, so clients keep the same local port. Stopping the rule cancels the retry.

Edit, duplicate and delete

  • Click a rule, or right-click and choose Edit, to change it. The panel title is Edit Port Forward Rule and the button is Save. If the rule is running, stop and start it again to apply the change.
  • Right-click and choose Duplicate to copy a rule. The copy is named … (copy) and never auto-starts.
  • Hover a rule and click the trash icon, or right-click and choose Delete. YourSSH asks Delete rule? first, naming the label and endpoints, with Cancel selected by default. After you confirm, a running rule is stopped and removed. Deleting a host also stops the tunnels that use it.
Edit Port Forward Rule panel next to the rule list

Clicking a rule opens it in the editor.

Example: reach a database on the SSH host

To connect a SQL client to a PostgreSQL server that only listens on the SSH host: Start the rule, then point your client at 127.0.0.1:5432.

Use tunnels in Web Tools

The Web Tools plugin has a Port Tunnels tool that works with these forwarded ports, so you can open a tunnelled web service in the in-app browser. See Web Tools.
  • Hosts for saved hosts and connection chains.
  • SFTP and Terminal use the same SSH connection settings.
  • DevOps Hub for Cloudflare tunnels and other tunnel tools.