Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to login to EC2 (AWS) using Putty

I want to login to the instance i created on Amazon Web Services. I get the following error.

login as: root
Server refused our key
Using keyboard-interactive authentication.
Password: 

I dont know what to enter as Password. I have given the privatekey created from PuttyGen.

like image 933
dinesh707 Avatar asked Aug 04 '11 10:08

dinesh707


People also ask

Can't connect to EC2 instance in PuTTY?

In PuTTYgen, load your private key file and select Save Private Key rather than Generate. Verify that you are connecting with the appropriate user name for your AMI. Enter the user name in the Host name box in the PuTTY Configuration window. For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user .

Can't connect to EC2 SSH?

This error occurs if you created a password for your key file, but haven't manually entered the password. To resolve this error, enter the password or use ssh-agent to load the key automatically. There are a number of reasons why you might get an SSH error, like Resource temporarily unavailable.


2 Answers

The username of Amazon AMI is difference depend on the AMI creator,

for Amazon AMI , user ec2-user for Ubuntu AMI , user ubuntu

You may search from the ami-id to see what is the default username of that AMI. Please ensure that this key you use is the private key for the public key which you put to key-binding when you created the instance.

like image 66
scalopus Avatar answered Oct 07 '22 17:10

scalopus


Try logging in as ec2-user. On the instances I have tried root login was disabled by default.

like image 44
Jared Bartimus Avatar answered Oct 07 '22 17:10

Jared Bartimus