2013年12月5日 星期四

upload single ssh public key for all ec2 regions

Prerequisite:
    EC2-API-Tools
    ssh-keygen to create ssh key pairs on linux

Parameters:  
    region names: such as ap-southeast-2,....
    keypair-names: for example, my-ec2-keypairs


for r in us-east-1 ues-east-2 us-west-1 us-west-2 ap-southeast-1 ap-southeast-2 eu-west-1; do ec2-import-keypair --region $r your-keypair-name --public-key-file ~/.ssh/id_rsa.pub ; done


REF:
http://aws.typepad.com/aws/2010/09/new-amazon-ec2-feature-bring-your-own-keypair.html

http://www.pyrosoft.co.uk/blog/2010/10/27/import-your-own-rsa-ssh-key-into-amazon-ec2/





沒有留言:

張貼留言