Skip to content

Instantly share code, notes, and snippets.

@fwip
Created July 26, 2015 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwip/0c1915144ce71c162cec to your computer and use it in GitHub Desktop.
Save fwip/0c1915144ce71c162cec to your computer and use it in GitHub Desktop.
#!/bin/bash
username="MYUSERNAME"
origPort="80"
midlPort="38080"
destPort="80"
midlHost="MYMIDDLEMAN"
destHost="MYDESTINATION"
# Sudo is just needed for privileged ports; if forwarding non-80 do not use.
sudo \
ssh "-L$origPort:localhost:$midlPort" "$username@$midlHost" -t \
ssh "-L$midlPort:localhost:$destPort" "$username@$destHost"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment