Created
November 24, 2015 04:49
-
-
Save Japh/63b4a53883d68c648e77 to your computer and use it in GitHub Desktop.
Spinnaker tunnelling
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 | |
socket=$HOME/.ssh/spinnaker-tunnel.ctl | |
if [ ! \( -e ${socket} \) ]; then | |
echo "Opening tunnel to Spinnaker..." | |
ssh -f -N spinnaker-start && echo "Tunnel open." | |
else | |
echo "Closing tunnel to Spinnaker..." | |
ssh -O "exit" spinnaker-stop && echo "Tunnel closed." | |
fi |
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
Host spinnaker-start | |
HostName <hostname-here> | |
IdentityFile <path-to-keypair-here> | |
ControlMaster yes | |
ControlPath ~/.ssh/spinnaker-tunnel.ctl | |
RequestTTY no | |
LocalForward 9000 127.0.0.1:9000 | |
LocalForward 8084 127.0.0.1:8084 | |
LocalForward 8087 127.0.0.1:8087 | |
User ubuntu | |
Host spinnaker-stop | |
HostName <hostname-here> | |
IdentityFile <path-to-keypair-here> | |
ControlPath ~/.ssh/spinnaker-tunnel.ctl | |
RequestTTY no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the entries above in my
~/.ssh/config
, and the bash script, I can just run./spinnaker-tunnel.sh
and toggle whether I'm connected to the AWS instance to use Deck in my browser. Simples!