tags:

views:

235

answers:

3

I set up an ec2 instance. In the security group, I opened up SSH 'tcp' port 80 for 0.0.0.0/0 (all open for testing purposes). I associated the instance with a private key. I downloaded the key and passed it while ssh-ing, but the RSA isn't authenticating. Any ideas?

ssh -i mykey.pem [email protected] 

The authenticity of host 'mydns.amazonaws.com(IP)' can't be established. 
RSA key finger print is FINGERPRINT 
Are you sure you want to continue connecting (yes/no)? 

Thank you in advance!!!

A: 

Oh, you are supposed to say yes anyways, I was confused as to how SSH RSA keys work. Now I get it! Thank you.

sharon
+1  A: 

This is normal. Your SSH comlpains about the unknown host key. It always does when connecting to the new host for the first time. Just answer yest, connect and try again. It should not complain for the second time.

The private key that you downloaded is for your 'root' account not for the whole host.

Vlad
Unless given `-o StrictHostKeyChecking=no` or the same in `ssh_config`.
ephemient
This is not safe practice, especially so with EC2.
Heikki Toivonen
+1  A: 

Securely configured EC2 instances will include the server SSH key fingerprint in the console output that you can access over SSL before you try to connect over SSH. Then when you connect over SSH you need to make sure the fingerprint matches the console. You MUST do this to be able to securely connect to public EC2 instances.

Public EC2 instances generate new server SSH key on each boot. This means that unless you do what I described above, you will be faced with unknown host key warning a lot, and if you ignore that warning you will be throwing security out of the door; you just never know where you will be connecting to.

Heikki Toivonen