3

Already looked for a solution but nothing seems to be helpfull, I'm doing everything that is meant to be made and my instance keeps returning me the message "Server refused our key".

Here's what I've been doing:

1) Create Instance;
2) Download the .pem key;
3) PuttyGen to transform it in a private .ppk (SSH-2 RSA);
4) Associate an Elastic IP to the Instance;
5) Connect through 22 with the correct auth key generated on the 3rd step;
6) Server asks for username, insert "ubuntu" (using 12.04.1 LTS);
7) Server returns "Server refused our key".

Tried to reboot a hundred times, tried SSH-1 RSA, tried public key instead of private key, tried keys with passphrase, tried everything.

Someone else is experiencing this?

Edit:

Thought it might be a security problem, here are my rules if that helps:

https://i.stack.imgur.com/Y3I2s.png

  • Do you have any unix instance might be on ur local box or any of ur other servers ? Or install cygwin on your windows. From this windows instance try to connect to your ec2 instance using $ssh -i prod.pem ubuntu@ec2-12.12.12.12.xyz.com – Deepak Singhal Jan 15 '13 at 11:01
  • Also try to use other logins - root, ec2-user. – Nickolay Olshevsky Jan 15 '13 at 11:07
  • Same error trying to connect with Cygwin, and all other possible logins were tested, I'm about to cry, I know I'm doing everything how it's meant to be made, I have like 10 EC2 instances running, never had this problem b4. –  Jan 15 '13 at 11:11

1 Answers1

4

Just got into the same issue. AWS instance recognize only the key which was specified during the instance creation. All later changes to the key list will not affect already created instance.

Edit: actually, here problem was in incorrect export to .ppk file using Puttygen. See comments below.

Nickolay Olshevsky
  • 13,706
  • 1
  • 34
  • 48
  • Yeah, that's why I'm curious, because I'm using the same key that was specified during the instance creation. –  Jan 15 '13 at 10:45
  • So why you 'generating a private key' with Puttygen on the 3rd step? .pem key, downloaded during instance creation, is the needed key. The only thing you can do with it - import to Puttygen and save .ppk key so it can be used with Putty. – Nickolay Olshevsky Jan 15 '13 at 10:48
  • "Generating a private key" is exactly what you said, importing the .pem key that AWS gave me on the instance creation to PuttyGen and saving as a .ppk key. Edited my first post to be more clear about what I meant to say. –  Jan 15 '13 at 10:53
  • 1
    I see. Just to be sure that you are not generating new key instead of loading one - you should run Puttygen, press 'Load', load your PEM file, and after that press 'Save private key'. – Nickolay Olshevsky Jan 15 '13 at 11:04
  • 1
    Conversions > Import Key (.pem) > Generate > *Random Mouse movements* > Save private key –  Jan 15 '13 at 11:08
  • 1
    That's wrong, you are generating new key. Do what I said in previous comment. – Nickolay Olshevsky Jan 15 '13 at 11:10
  • 1
    **Holy crap, you're right, it worked. I can't believe that this was the problem, how stupid am I? ROFL, thanks a lot fellow.** –  Jan 15 '13 at 11:14