Last active
April 11, 2018 12:45
-
-
Save adamjarret/f31d08138b162b383e3954be18ee101e to your computer and use it in GitHub Desktop.
Get ssh command for connecting to AWS Cloud9 EC2 Environment (forward port 8080)
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 | |
WAN=$(curl -s https://api.ipify.org) | |
LAN=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1) | |
echo "ssh ec2-user@$WAN -L 8080:$LAN:8080" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment