Skip to content

Instantly share code, notes, and snippets.

@sinewalker
Created April 3, 2019 04:37
Show Gist options
  • Save sinewalker/968f2865282d53319022649dcdff9322 to your computer and use it in GitHub Desktop.
Save sinewalker/968f2865282d53319022649dcdff9322 to your computer and use it in GitHub Desktop.
SSH jump to one host via another
Host *-via-jumpbox
ProxyCommand ssh [email protected] nc $(echo %h | sed 's/-via-jumpbox$//') %p
@sinewalker
Copy link
Author

Put this snippet into your ~/.ssh/config and you can SSH to any host (that is reachable) via your user on a (fictitious) jumpbox

  • user = your username at jumpbox.net
  • jumpbox.net = some unix machine you can SSH to, that has nc (netcat) and sed installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment