Skip to content

Instantly share code, notes, and snippets.

@awilliams
Created October 29, 2014 11:16
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 awilliams/7b6f3f9e4bc042501736 to your computer and use it in GitHub Desktop.
Save awilliams/7b6f3f9e4bc042501736 to your computer and use it in GitHub Desktop.
sshtunnel helper
#!/usr/bin/env bash
# ARG1 = remote host, ie db.example.com
# ARG2 = port to forward, ie 8080
set -eu
echo "Tunneling $1 -> http://sshtunnel:$2"
#open /Applications/Google\ Chrome.app/ "http://sshtunnel:$2/"
ssh -C $1 -L $2:localhost:$2 -N
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment