Termius is a popular SSH client with desktop (macOS, Windows, Linux) and
mobile (iOS, Android) apps. Unlike OpenSSH, Termius does not use
~/.ssh/config, so pastelocal cannot auto-edit your SSH configuration.
Instead, you configure the Remote port forwarding manually inside the
Termius UI.
Note: The Termius UI may change in future versions. The menu names and field labels below are accurate as of the current release. If you can't find a setting, look for similarly-named options in the port forwarding or advanced settings section.
pastelocal initThis starts the daemon on port 7331 (default) and stores the auth token.
pastelocal add-host myserver --termiusThis prints the exact values you need to enter in Termius. The output looks like:
Open Termius → Hosts → myserver → Edit → Advanced → Port Forwarding
Add a new entry:
Type: Remote
Local: 127.0.0.1
Local Port: 7331
Remote: 127.0.0.1
Remote Port: 7331
Then run: pastelocal add-host myserver --finish
-
Open Termius.
-
Go to Hosts in the left sidebar.
-
Select your remote host (e.g.,
myserver). -
Click Edit (pencil icon or right-click → Edit).
-
Expand the Advanced section.
-
Find Port Forwarding.
-
Click Add or + to create a new forwarding rule.
-
Fill in the fields:
Field Value Type Remote Local Address 127.0.0.1Local Port 7331(or your custom port)Remote Address 127.0.0.1Remote Port 7331(or your custom port) -
Save the host configuration.
pastelocal add-host myserver --finishThis copies the pastelocal-remote binary, the auth token, and the skill
file to the remote host via SCP. It skips the SSH config edit (since
Termius handles that part).
- Connect to the host in Termius. The port forwarding is established automatically when the SSH session starts.
- On the remote host, run:
pastelocal-remoteIf you have an image on your local clipboard, this prints a file path. If it prints "tunnel not connected: connection refused", the port forwarding isn't active yet — reconnect in Termius.
On your laptop (not the phone), run:
pastelocal init
pastelocal add-host myserver --termiusNote the port values printed (default: 7331).
-
Open Termius on your phone.
-
Go to Hosts.
-
Tap your remote host.
-
Tap Edit (gear or pencil icon).
-
Scroll to Port Forwarding or Advanced.
-
Tap Add to create a new rule.
-
Fill in the fields:
Field Value Type Remote Local Address 127.0.0.1Local Port 7331Remote Address 127.0.0.1Remote Port 7331 -
Save the host configuration.
On your laptop, run:
pastelocal add-host myserver --finish- Connect to the host in the Termius mobile app.
- On the remote host, run
pastelocal-remoteto test.
Note on mobile: The "local" side of the RemoteForward is your phone, which may not have a running
pastelocalddaemon. For the mobile workflow, you typically use a desktop machine as the local clipboard source and the phone only for initiating the SSH connection. The daemon must be running on the machine that has the clipboard you want to share.
The port forwarding isn't active. This means either:
- You haven't connected to the host in Termius yet. Fix: Open an SSH session to the host first.
- The port forwarding rule isn't saved or was configured incorrectly.
Fix: Double-check all five fields (Type, Local Address, Local Port,
Remote Address, Remote Port) against the values from
pastelocal add-host <alias> --termius. - You're using a non-default port. Fix: Make sure the port in Termius
matches the port in
~/.config/pastelocal/config.toml.
The token on the remote host doesn't match the local token. This happens if
you ran pastelocal init again or pastelocal rotate-token without
updating the remote.
Fix:
pastelocal add-host myserver --update-token-onlyTermius saves port forwarding rules per-host, so they should persist. If they don't:
- Check that you saved the host edit after adding the rule.
- Try deleting and re-adding the rule.
- On mobile, make sure you're editing the correct host entry.
The --finish step didn't complete or the binary was removed.
Fix:
pastelocal add-host myserver --finishYes. If you changed the port in config.toml or used --port during
pastelocal init, use that same port in both the Local Port and Remote Port
fields in Termius. The two must always match.
Each host needs its own port forwarding rule. Run pastelocal add-host <alias> --termius for each host and configure the rule in the corresponding
Termius host entry.