Contents
- When do you need an SSH jump host?
- What has to work at each hop?
- How do you check the route before configuring it?
- How do you set up ProxyJump step by step?
- How do you verify the connection and add another hop?
- Why does the bastion work while the target fails?
- Why should you avoid agent forwarding and copied keys?
- How do you keep the route reliable and restricted?
- How does CH-J Tools handle jump hosts?
- Frequently asked questions
When do you need an SSH jump host?
Your workstation can reach bastion.example, but server.example is on an internal network without a public SSH endpoint. Opening another firewall rule from the Internet to the internal server is not the intended access path. Instead, you authenticate to the bastion and ask it to carry the connection to the internal server. This arrangement is commonly called a jump host or bastion.
OpenSSH provides this route through ProxyJump, also available as the command-line option -J. You run the client on your own computer rather than logging into the bastion and starting a second SSH client there. The target session is encrypted between your workstation and the target; the bastion carries that encrypted stream. Your private authentication keys stay on your workstation.
The examples below use OpenSSH on Linux, macOS or Windows with the OpenSSH client installed. Replace the example names, accounts, ports and key paths with your inventory values. Here, bastion.example is reachable from the workstation and server.example is reachable from the bastion. Both use SSH port 22 unless explicitly stated otherwise.
What has to work at each hop?
There are two independent SSH authentications and two server identities to verify. A successful bastion login does not grant access to the target. The target must accept your own account and authentication method, and its host key must match the identity you expect. Accounts and keys can differ between the two machines.
- Your workstation needs a working network path to the bastion SSH port, including any required VPN connection.
- The bastion needs name resolution and TCP connectivity to the target SSH port. With the ordinary ProxyJump setup, the target name is resolved on the bastion.
- The bastion SSH policy must permit the forwarding request to that destination. Shell access alone does not prove forwarding is allowed.
- The target firewall normally sees the connection arriving from the bastion, or from a translated address on that path, rather than from your workstation.
ProxyJump does not make the bastion irrelevant to security. Its administrator can observe connection destinations and timing, and the bastion can interrupt traffic. Verification of the target host key is what prevents a substituted SSH server on that path from silently becoming your destination.
How do you check the route before configuring it?
First obtain the expected host-key fingerprints for both servers from an administrator or a trusted console. On each Linux server, the following command reads the public Ed25519 host key. Run it through the trusted console, not through a connection whose identity you are still investigating. If the server uses a different host-key type, inspect that public key instead.
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub -E sha256On Windows Server running OpenSSH, use PowerShell on the trusted server console and read the corresponding file under C:\ProgramData\ssh:
ssh-keygen -lf C:\ProgramData\ssh\ssh_host_ed25519_key.pub -E sha256From the workstation, test the bastion alone. Compare the entire offered fingerprint before accepting a first connection. A successful interactive login confirms basic reachability and authentication; exit that shell before testing the full route. If the bastion is intentionally restricted to forwarding, a denied shell does not by itself mean the jump route is broken.
ssh user@bastion.exampleStop if either server presents an unexpected changed host key. Verify the change independently before replacing its stored entry. Disabling host-key checking or deleting the entire known_hosts file removes protection rather than repairing the route.
How do you set up ProxyJump step by step?
For a one-off connection, supply the bastion after -J and the target last. Each user name belongs to the server immediately following it. With different accounts, change them independently. During the first full connection, verify the target fingerprint as carefully as the bastion fingerprint.
ssh -J user@bastion.example user@server.example- For repeat use, edit your local OpenSSH user configuration. On Linux and macOS this is ~/.ssh/config; on Windows it is %USERPROFILE%\.ssh\config, without a .txt extension.
- Create one Host block for the bastion and another for the target. The Host names are local aliases; HostName contains the actual network name.
- Set the correct User, Port and IdentityFile for each server. The example assumes the two named private key files already exist locally and the corresponding public keys are authorized on the appropriate servers.
- Add ProxyJump only to the target block, pointing to the bastion alias. Save the file, inspect the effective settings, and connect using the target alias.
Host bastion
HostName bastion.example
User user
Port 22
IdentityFile ~/.ssh/id_ed25519_bastion
IdentitiesOnly yes
ForwardAgent no
Host app-internal
HostName server.example
User user
Port 22
IdentityFile ~/.ssh/id_ed25519_app
IdentitiesOnly yes
ForwardAgent no
ProxyJump bastionPut specific Host blocks before broad defaults such as Host *. OpenSSH generally uses the first value obtained for a setting; IdentityFile can accumulate multiple entries. Options for the target are not generally inherited by jump hosts. In particular, adding -i to the final ssh command does not configure a separate bastion identity. Keep that identity in the bastion block.
How do you verify the connection and add another hop?
Inspect each alias locally with -G. This prints the evaluated configuration without opening an SSH session. Check hostname, user, port, identityfile, forwardagent and proxyjump. The bastion should not inherit a route back through itself. Review any existing ProxyCommand setting too: it competes with ProxyJump, and whichever is specified first takes effect.
ssh -G bastion
ssh -G app-internal
ssh app-internalAfter login, confirm you reached the intended target, not merely a familiar-looking shell. For a Linux target, the following harmless remote command prints the host name and account. Compare those values with your inventory. This operational check supplements host-key verification; a printed host name alone is not proof of server identity.
ssh app-internal "hostname; whoami"For two jump hosts, separate the hops with commas in travel order. In this example, bastion.example must reach hop2.example, and hop2.example must reach server.example. Verify all three host keys. Each additional hop adds another network dependency and another authentication step; do not add one unless the network layout requires it.
ssh -J user@bastion.example,user@hop2.example user@server.exampleWhy does the bastion work while the target fails?
Run verbose diagnostics from the workstation and identify the last successful stage. Inspect the bastion separately if its authentication fails before forwarding starts. Repeated password prompts may belong to different servers, so read the account and host in each prompt rather than assuming the same password was rejected twice.
ssh -vvv bastion
ssh -vvv app-internal- A timeout before bastion authentication points to its address, SSH listener, routing, VPN or firewall. Check this first; target-side changes cannot repair it.
- An open failed message containing Name or service not known points to name resolution for the forwarded destination. Check the target name from the preceding hop, not only from your workstation.
- Connection refused for the forwarded destination usually means the address is reachable but nothing accepts that port, or a firewall actively rejects it. Check the target SSH listener and selected port.
- Administratively prohibited indicates a forwarding policy restriction. Review AllowTcpForwarding, DisableForwarding, PermitOpen, applicable Match blocks and restrictions on the bastion account key.
- Permission denied after the target SSH exchange is an authentication issue on the target. Confirm its user name, selected identity and authorized public key before changing forwarding policy.
AllowTcpForwarding no prevents the required forwarding. A policy permitting local TCP forwarding can support ProxyJump, but other restrictions can still deny a specific destination. Ask the bastion administrator to check the effective policy for your account instead of enabling unrestricted forwarding globally. Verbose logs contain internal names and account details; redact those before sharing them.
Why should you avoid agent forwarding and copied keys?
ProxyJump authenticates to the target from your local client, so it does not require ssh -A. You can use a local authentication agent without forwarding it. ForwardAgent no in both example blocks keeps that distinction explicit. It does not disable the agent on your workstation.
With agent forwarding enabled, someone with sufficient access on the bastion may use the forwarded agent to authenticate with your loaded keys while it is available. They do not need to extract the private key to misuse that access. Avoid forwarding an agent just to make the next hop work.
Do not copy your private target key onto the bastion as a workaround. Authorize the corresponding public key on the target and keep the private part local. Also avoid mixing a manually nested SSH session with the ProxyJump procedure: commands started inside the bastion shell use that machine as their client and therefore have different key files and trust records.
How do you keep the route reliable and restricted?
Maintain a small route inventory listing each hop, account, port, approved destination and verified host-key fingerprint. When a bastion is replaced, verify its new identity independently; do not assume the target key should change too. The two servers have separate identities even though the route uses both.
- Restrict who can access the bastion and which internal SSH destinations they need. Coordinate destination restrictions with network firewall rules.
- Keep bastion and target systems maintained, and remove obsolete accounts and authorized public keys when access ends.
- Before changing SSH access policy, retain a working administrative session and a trusted console path. Validate configuration and test a fresh connection before closing your fallback session.
- After a DNS, firewall or account change, test the complete route from a normal workstation. A successful direct login from the bastion exercises a different authentication setup.
How does CH-J Tools handle jump hosts?
Alpha 0.1.1 connects through a saved or manually entered jump host. Saved hosts can form a chain of up to three jump hosts, and the host key is checked on every hop.
The availability monitor checks a server behind a jump host only through an open session to that jump host. Otherwise it shows the server as not verified, never as online. Beta 0.1.0 does not have this feature.
Frequently asked questions
How do I use different ports for the bastion and target?
Use ssh -J user@bastion.example:2222 -p 2200 user@server.example. The port inside -J belongs to the bastion; -p belongs to the target. In saved configuration, put Port in each server's own Host block.
Can SFTP use the same jump host?
Yes. With the OpenSSH configuration above, sftp app-internal uses the target alias and its ProxyJump route. The target must provide an SFTP subsystem and permit your account to use it; a working SSH route alone does not guarantee file access.
Does my workstation need to resolve the internal target name?
With ordinary ProxyJump forwarding, the bastion resolves the target name. Your workstation must resolve the first bastion. Local hostname canonicalization or other custom client settings can add local DNS requirements, so inspect existing configuration if behavior differs.
Is a VPN required when using a jump host?
Only if your network policy requires a VPN to reach the bastion or another necessary part of the route. ProxyJump carries SSH traffic through a reachable SSH server; it does not provide general network access to every internal service.
Do I need a shell account on the bastion?
You need an SSH account permitted to authenticate and forward to the required destination. An interactive shell is not required by ProxyJump itself. An administrator can restrict the account to forwarding, provided those restrictions still allow the required connection.
Detailed documentation
OpenSSH: ssh_config (ProxyJump) →
OpenSSH: sshd_config (forwarding restrictions) →