Created
June 24, 2015 08:21
-
-
Save burdandrei/6a1cd5fe4aba5f0824a7 to your computer and use it in GitHub Desktop.
Example of forwarding remote port to localhost (Connecting to DB behind the firewall through the SSH Tunnel)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
REMOTE_HOST=ip-10-2-10-197.ec2.internal # Related to PROXY_HOST | |
REMOTE_PORT=27017 | |
LOCAL_PORT=27017 | |
PROXY_HOST=ec2-55-210-99-165.compute-1.amazonaws.com | |
ssh -f -L ${LOCAL_PORT}:${REMOTE_HOST}:${REMOTE_PORT} $PROXY_HOST -N |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment