Skip to content
moshpit

Docs · Topic

Jump hosts

When the machine you work on is only reachable through another SSH server—such as a compute node behind a cluster login node or a private host behind a bastion—Moshpit connects through a saved jump host the same way ssh -J login.example.com gpu01.example.com does on a laptop.

  1. On Home, tap Add connection and enter the bastion or login node (for example login.example.com, user dev, and its own Password or SSH key).
  2. If you never open a terminal on the jump host itself, turn on Jump host only. That keeps it out of the main host list on Home (tucked under Jump hosts at the bottom) while still offering it in Connect via.
  3. Tap Save.
  4. Tap Add connection again (or open Edit connection on your target machine, such as gpu01.example.com).
  5. Under JUMP HOST, tap Connect via and pick login.example.com (or tap New connection… to create the jump host on the spot).
  6. Configure the target host’s own User and Sign in with credentials, then tap Save.

To change the bastion’s credentials or port later without hunting for it on Home, open Edit connection on the target host and tap Edit jump host….

Moshpit signs in to the jump host first using the jump host’s saved key or password, opens a forwarded TCP channel from there to the target’s Host and Port, and then verifies the target’s host key and signs in with the target’s own credentials. The jump host never sees your target private key.

The SSH server on the jump host must allow TCP forwarding (AllowTcpForwarding yes in sshd_config, which is the OpenSSH default).

Rule Why
One hop A host that another connection uses as its jump host connects Direct. Chaining multiple jump hosts is not supported.
SSH only Mosh needs UDP straight from your phone to mosh-server on the target machine. When Connect via is set to anything other than Direct, Moshpit disables Use mosh and uses SSH.
Per-hop errors If the connection fails, the Home card names which of the two hosts failed—for example Jump host “login.example.com”: Timed out versus a refusal on the target itself. See When it can’t connect.