User Tools

Site Tools


ssh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
ssh [2021/07/06 05:05] – [Reverse proxy] vissiessh [2021/10/06 03:19] (current) – [CentOS] vissie
Line 232: Line 232:
  
 Happy days... Happy days...
 +
 +
 +====ProxyJump====
 +The ProxyJump, or the -J flag, was introduced in ssh version 7.3. To use it, specify the bastion host to connect through after the -J flag, plus the remote host:
 +  ssh -J <bastion-host> <remote-host>
 +You can also set specific usernames and ports if they differ between the hosts:
 +  ssh -J user@<bastion:port> <user@remote:port>
 +The ssh man (or manual) page (man ssh) notes that multiple, comma-separated hostnames can be specified to jump through a series of hosts:
 +  ssh -J <bastion1>,<bastion2> <remote>
 +
 +====Hard-coding proxy hosts in config====
 +The -J flag provides flexibiltiy for easily specifying proxy and remote hosts as needed, but if a specific bastion host is regularly used to connect to a specific remote host, the ProxyJump configuration can be set in ~/.ssh/config to automatically make the connection to the bastion en-route to the remote host:
 +<sxh bash; gutter: false>
 +### The Bastion Host
 +Host bastion-host-nickname
 +  HostName bastion-hostname
 +
 +### The Remote Host
 +Host remote-host-nickname
 +  HostName remote-hostname
 +  ProxyJump bastion-host-nickname
 +Using the example configuration above, when an ssh connection is made like so:
 +</sxh>
 +  ssh remote-host-nickname
  
 =====Reverse proxy===== =====Reverse proxy=====
ssh.1625573150.txt.gz · Last modified: 2021/07/06 05:05 by vissie