Strovent SystemsSign in
Reference

Jump hosts (ProxyJump)

How a bastion or jump host works, why it is safe, and the syntax for one or several hops.

A jump host (or bastion) is a machine you can reach from outside that can reach machines you cannot. You connect to the jump host first, and from there to the target.

What really happens

With ProxyJump the client connects to the jump host. It then asks the jump host to open a TCP channel to the target, and runs a second SSH connection through it. So:

Command line

ssh -J jump.example.com target.internal
ssh -J user1@jump1,user2@jump2 target

The config file form:

Host target
  HostName 10.0.5.20
  ProxyJump [email protected]

Compared with other approaches

  • Agent forwarding puts your agent on the jump host. A jump host does not need it. See The agent and agent forwarding.
  • ProxyCommand (ssh -W host:port jump) is the older way. ProxyJump is the same idea, shorter.
  • A shell on the jump host and then ssh target works but exposes more.

Not everything works through it

  • Mosh uses UDP to the target directly, so it cannot go through a jump host. Use SSH instead. See Mosh requirements. For the options, see Can Mosh go through a jump host or bastion?.
  • A jump host must allow TCP forwarding (AllowTcpForwarding in its sshd_config). If it forbids it the target connection fails.

Spotted a mistake? Email [email protected].