↑ ↓ select, Enter open, Esc close

Connect to an internal server through a jump host

Adjust the values, the command updates live
user@server
ssh -J admin@bastion.example.com webuser@10.0.0.12

First connects to the jump host and tunnels the actual SSH session to the target server through it. Authentication on the target still runs end to end with your local key, so the private key does not have to be stored on the jump host. Multiple hops can be specified separated by commas.

Note: To make this permanent, use ProxyJump in ~/.ssh/config.

Also searched as

  • ssh through bastion host
  • ssh proxyjump example
  • ssh -J jump host

Related one-liners

All in SSH

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.