Amazon AWS EC2 - Getting a .cer file instead of .pem

amazon-ec2, amazon-web-services, ssh

Solution

I have just started working on the Amazon AWS platform and came across this question.

Not sure if you managed to resolve your issue - however, here is a AWS forum thread that talks of a related issue and the solution:

ssh error: "Enter passphrase for key 'id_rsa-gsg-keypair'"

To summarize the thread - the problem seems to be with the permissions on the .cer file that was downloaded.

Another thing about the .cer file - A .cer file is essentially confirmant with the PEM format and hence there should be no problem using the .cer file just like you would use a .PEM file.

I downloaded my .cer file and was able to connect to my Amazon Linux instance using it after having the correct permissions (chmod 400 mykey.cer) and then using it in the ssh command as below:

ssh -i mykey.cer ec2-user@public-dns-of-my-amazon-instance

Probably the connecting user varies for other linux instances. More information here

Problem

When i downloaded my private key file from Security Credentials, I got a .cer file instead of a .pem. I tried to ssh to my ec2 instance using that but i am constantly getting: Bad passphrase, try again for pk-xxxxxxxxxxx Is it because i have a .cer file or because i need a pass phrase? I do not know what is a passphrase. I would really appreciate if i can be helped soon. I think i am confusing the the .cer files i get from X.509 with the file i need for ssh. But the problem is i never get .pem files, only .cer file

Original source