Connecting to EC2 with Putty(SSH): Server refused our key error

September 22, 2011 § Leave a comment

I’m going to assume you are using  Putty on a Windows machine, this error usually happens because you are using your Amazon private key file, and Putty doesn’t support the format of such file, so  you will need to convert this Amazon file to Putty format, to do this you will need to PuTTYgen, which is a Putty tool for this purpose. for more details see AWS docs here and  scroll to the section “Connecting from a Windows machine”.


Connecting to EC2 instance:Permission denied (publickey) error

September 22, 2011 § Leave a comment

You connect to your Ec2 instance by:

ssh  -i private.pem {user}@{ip}


private.pem is your Amazon key pairs file

user is the login name, this is the problem usually, and it’s NOT always root or ec2-user, different AMIs use different login name, so you really have to see the documentation for your AMI. for instance, Ubuntu releases by Canonical use the user ‘ubuntu’, where Ubuntu releases by bitnami use ‘bitnami’ as the default user.

ip is your instance public ip, could be like this

Where Am I?

You are currently browsing entries tagged with SSH at Mohamed Elbou.