Skip to content

Instantly share code, notes, and snippets.

@MartijnBraam
Created March 2, 2017 20:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartijnBraam/2e5c3e4ee23d2f76ac9834dec2ffb028 to your computer and use it in GitHub Desktop.
Save MartijnBraam/2e5c3e4ee23d2f76ac9834dec2ffb028 to your computer and use it in GitHub Desktop.
SSH jumphost shortcut
Host *+*
ProxyCommand ssh $(echo %h | sed 's/+[^+]*$//;s/\([^+%%]*\)%%\([^+]*\)$/\2 -l \1/;s/:/ -p /') exec nc -w1 $(echo %h | sed 's/^.*+//;/:/!s/$/ %p/;s/:/ /')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment