I am new to Amazon EC2 and trying to configure it. I have created the instances and trying to connect. I am getting the error as "Disconnected : No supported authentication methods available (server sent :publickey)".
I have got the keypair from EC2 Management console and have used putty gen to generate private key file(PPK).
Kindly assist to resolve.
I have already referred Google server putty connect 'Disconnected: No supported authentication methods available (server sent: publickey) but couldn't get my problem resolved.
For the record, the usual default username in EC2 for these Linux distro:
- Amazon Linux: ec2-user
- Ubuntu: ubuntu
- Debian : admin
To access the instance through a browser, make sure you add a rule in your security group to allow port 80 and port 443 inbound.
I was having the exact same problem on Amazon EC2 and I simply changed my username to "ubuntu" and it made a connection.
Use the public dns name instead of IP.
In the putty, choose connection > SSH > Auth.
You will see the Authentication Parameter part,
in there you can choose your ppk file.
And one more very important thing.
Click the "Allow attempted changes of username in SSH-2" to activate it.
I had the same problem even with ec2-user, I used Public DNS instead of Public IP. It resolved now.
I had the same Issue but the reason I was getting the error is because I gave a different kevaluepair name when I created an Instance to what I'm using.
Make sure that the key value pair name is same across all situations.
It's important to understand that if your instance is created by any any other service (like Elastic Beanstalk) and not directly from EC2, you are likely to face similar problems.
It is possible the there is no Key pair associated with your instance yet. To validate this go to your instance from
EC2 dashboard > Description
Look out for 'Key pair name' there. If there is a valid value there (this must the same you used to generate the key from Putty Key Generator) then this suspicion can be overruled. Otherwise you may need to recreate instance as a worst case scenario.
In my case, the instance was create by Elastic Beanstalk i.e. EBS (another AWS service) where I hosted a web application, I attached an existing key pair to the EBS environment and the connection through Putty went through.