Skip to content

Instantly share code, notes, and snippets.

@jkullick
Created August 4, 2016 13:46
Show Gist options
  • Save jkullick/f8cd30ae64361620c6b072c94bf55938 to your computer and use it in GitHub Desktop.
Save jkullick/f8cd30ae64361620c6b072c94bf55938 to your computer and use it in GitHub Desktop.
SSH Tunnel Cheat Sheet
# $LOCAL_IP: 'localhost' or machine from local network
# $LOCAL_PORT: open port on local machine
# $REMOTE_IP: remote localhost or IP from remote network
# $REMOTE_PORT: open port on remote site

# Forward Tunnel: map port from remote machine/network on local machine
ssh -L $LOCAL_PORT:$REMOTE_IP:$REMOTE_PORT $USER@$SERVER

# Reverse Tunnel: make local port accessable to remote machine
ssh -R $REMOTE_PORT:$LOCAL_IP:$LOCAL_PORT $USER@$SERVER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment