Sören Bleikertz
18 Feb 2010

AWS EC2 SSH Config

In case you are connecting to various EC2 instances frequently for testing purposes, the following SSH config might be useful for you:

host *.amazonaws.com
    User root
    StrictHostKeyChecking no
    IdentityFile ~/.ssh/id_rsa-ec2
    UserKnownHostsFile ~/.ssh/ec2_hosts

Always connect as user root to amazonaws.com boxes, do not ask for accepting the host’s key, and use the ec2 private key for authentication.

Update: It’s also useful to define a separate known hosts file, so your regular one does not get cluttered with host keys from AWS test systems.