Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 SSH problem authenticating

Tags:

ssh

amazon-ec2

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!!!

like image 897
sharon Avatar asked Mar 02 '10 04:03

sharon


Video Answer


2 Answers

This is normal. Your SSH complains about the unknown host key. It always does when connecting to the new host for the first time. Just answer yes, 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.

like image 152
Vlad Avatar answered Oct 08 '22 23:10

Vlad


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.

like image 40
Heikki Toivonen Avatar answered Oct 08 '22 23:10

Heikki Toivonen