Skip to content

Instantly share code, notes, and snippets.

@adamjarret
Last active April 11, 2018 12:45
Show Gist options
  • Save adamjarret/f31d08138b162b383e3954be18ee101e to your computer and use it in GitHub Desktop.
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)
#!/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