Skip to content

Instantly share code, notes, and snippets.

@maxclaus
Created June 17, 2015 19:52
Show Gist options
  • Save maxclaus/22d8a7d453e4f57e07b3 to your computer and use it in GitHub Desktop.
Save maxclaus/22d8a7d453e4f57e07b3 to your computer and use it in GitHub Desktop.
ssh tunnel and multiple tunnels
# single tunnel
ssh -L <local-ip-on-my-machine>:<local-port-on-my-machine>:\
<local-ip-on-server>:<local-port-on-server> \
-C -N <server-user>@<server-ip>
# EXMAPLES
# -------------
# SINGLE TUNNEL
ssh -L 0.0.0.0:27017:172.17.42.1:27017 -C -N [email protected]
# -------------
# MULTIPLE TUNNELS
ssh -L 0.0.0.0:27017:localhost:27017 [email protected] \
ssh -L 27017:172.17.42.1:27017 -N [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment