Skip to content

Instantly share code, notes, and snippets.

@yowcow
Last active June 19, 2017 05:06
Show Gist options
  • Save yowcow/db0dece40f880e6015c7427e67b74b87 to your computer and use it in GitHub Desktop.
Save yowcow/db0dece40f880e6015c7427e67b74b87 to your computer and use it in GitHub Desktop.
SSH Port Forwarding
# Local Forwarding
# For instance, connect to target mysql from localhost via proxying remote host:
# ssh -L <Local Port>:<Tartet Host>:<Target Host Port> Proxying Remote Host
ssh -L 3307:my-database-server:3306 my-app-server
# Remote Forwarding
# For instance, forwarding remote host port to target host port:
# ssh -R <Target Host Port>:<Target Host>:<Remote Host Port> Remote Host
ssh -R 5001:my-another-app-server:5000 my-app-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment