2012年5月7日月曜日

EC2を便利につかう.ssh/configの書きかた


というわけで実はあまり知られてない方法なのかもしれないので、具体例を晒しとく。
Host *.ap-northeast-1.compute.amazonaws.com
identityfile ~/.ssh/tokyo
user ec2-user
Host *.eu-west-1.compute.amazonaws.com
identityfile ~/.ssh/dublin
user ec2-user
Host *.sa-east-1.compute.amazonaws.com
identityfile ~/.ssh/saopaulo
user ec2-user
Host *.compute-1.amazonaws.com
identityfile ~/.ssh/virginia
user ec2-user
Host *.us-west-1.compute.amazonaws.com
identityfile ~/.ssh/california
user ec2-user
Host *.us-west-2.compute.amazonaws.com
identityfile ~/.ssh/oregon
user ec2-user
Host *.ap-southeast-1.compute.amazonaws.com
identityfile ~/.ssh/singapore
user ec2-user