Skip to content

Instantly share code, notes, and snippets.

@drbrain
Created March 20, 2013 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save drbrain/5202693 to your computer and use it in GitHub Desktop.
Save drbrain/5202693 to your computer and use it in GitHub Desktop.
Proxy SSH through hosts
Host *+*
ProxyCommand ssh $(echo %h | sed 's/+[^+]*$//;s/\([^+%%]*\)%%\([^+]*\)$/\2 -l \1/;s/:/ -p /') nc $(echo %h | sed 's/^.*+//;/:/!s/$/ %p/;s/:/ /')
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment