Created
August 15, 2017 04:39
-
-
Save shiumachi/9dac718cdcc5df3ccd5874a05a745cb1 to your computer and use it in GitHub Desktop.
指定したAWSインスタンスに対するSOCKSプロキシを構築するコマンドを取得する
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
PROFILE=your_profile | |
INSTANCE_NAME=your_instance_name | |
SSH_KEYPATH=your_ssh_key_path | |
PUBLIC_HOSTNAME=`aws --profile ${PROFILE} ec2 describe-instances | jq -r ".Reservations[] | select(.Instances[0].Tags[].Value == \"${INSTANCE_NAME}\") | .Instances[0] | .PublicDnsName"` | |
echo "establish SOCKS proxy" | |
echo "ssh -i ${SSH_KEYPATH} -D 8157 -q ec2-user@${PUBLIC_HOSTNAME}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment