Created
October 4, 2017 11:13
-
-
Save fokot/edbeec7de61552a291ef566bb55fba7e to your computer and use it in GitHub Desktop.
Bi-directional ssh tunnel
This file contains 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
#!/bin/bash | |
export EXTERNAL_PORT=$(cat conf/application.conf | awk -F'=' '/web.port/ {printf $2}' | tr -d ' ') | |
# this is the port for externalAddress | |
export TEMP_PORT=3331 | |
echo "" | |
echo "Connecting localhost:$EXTERNAL_PORT to <SERVER>:8076" | |
echo "As externalAddress in application.conf use \"http://localhost:$TEMP_PORT\"" | |
echo "" | |
ssh -N -L8076:localhost:8076 -R$TEMP_PORT:localhost:$EXTERNAL_PORT <USER>@<SERVER> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment