"Server refused our key" issue on connecting to Amazon Linux EC2 AWS image from Putty

nicolasdaudin picture nicolasdaudin · Aug 15, 2014 · Viewed 8.2k times · Source

I know this question has been asked and answered before, but I can't make it work although I triple-checked all the steps both in Amazon doc and here on StackOverflow.

So here we are: yesterday I launched an Amazon EC2 instance, with an Amazon Linux image - the one provided by Amazon themselves. I created a Key Pair for my Mac, and it's 100% fine - it works.

But today, trying to connect from work, from my PC, I can't make that work for Putty.

Steps I've done:

  • Created a new Key Pair
  • Used PuttyGen to transform the .pem file to .ppk
  • Created a new session on Putty, making sure that the host is [email protected] (I won't paste my complete ec2 host obviously)
  • Associated to that session the private key I previously generated.
  • Try to connect from Putty.

What I get:

This message: Using username "ec2-user". Server refused our key

And the popup with Title "Putty Fatal Error" that says "Disconnected: No supported authentication methods available"

Please help, I've tried everything:

  • Changing user to root and ubuntu
  • generating my own public/private key using PuttyGen
  • putting the IP insteaad of the DNS name

Nothing works... And the worst thing is that yesterday from my Mac, with a different key-pair and using vSSH, it worked.

I don't get it.

Thanks in advance for your precious help.

Nicolas.

Answer

nicolasdaudin picture nicolasdaudin · Aug 18, 2014

Well yes, as said, you need to use the same key pair. Maybe I'm dumb but anyway, now it works :)