Skip to content

Instantly share code, notes, and snippets.

@nagataka
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save nagataka/aa02c93798c78fad37ba to your computer and use it in GitHub Desktop.

Select an option

Save nagataka/aa02c93798c78fad37ba to your computer and use it in GitHub Desktop.
authorize_ssh_local.sh
#!/bin/sh
ip=`curl http://www.ugtop.com/spill.shtml | grep -o "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*"`
echo "your ip is: $ip"
# add rule to security group
aws ec2 authorize-security-group-ingress --group-id sg-xxxxxxxx --protocol tcp --port 22 --cidr ${ip}'/32'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment