-1

I have setup the keypair for my aws machine.

Added ssh - anywhere and icmp - anywhere inbound rules to my security groups.

I am able to ping the ec2 instance. but when I provide private key to my putty it asks for login as: .

Moment I provide my root user for my aws account or even "ec2-user" it says server "refused our key"

Anuj Gupta
  • 37
  • 1
  • 4
  • It would be `ec2-user` not `ec-user`. – Mark B Mar 21 '21 at 13:51
  • Likely duplicate of https://stackoverflow.com/questions/4742478/ssh-to-elastic-beanstalk-instance – Mark B Mar 21 '21 at 13:52
  • @MarkB My apologies. I tried ec2-user. – Anuj Gupta Mar 21 '21 at 14:27
  • if i remember correctly, putty needs a ".ppk" style private key. did you convert the key to ppk. https://aws.amazon.com/premiumsupport/knowledge-center/convert-pem-file-into-ppk/ – Arun Kamalanathan Mar 21 '21 at 23:55
  • "Refused our key" means it does not want to accept the keypair you have provided. Have you ever logged into this EC2 instance before? Was it launched with a keypair selected? How are you connecting to it? More information please! – John Rotenstein Mar 22 '21 at 00:58

1 Answers1

0

I am able to connect now. The key which I created was not associated with my instance.

I was able to associate keypair from elasticbeanstalk --> configuration --> Security.

After this I was able to login to EC2 via putty/winscp

Thanks all for providing help.

Anuj Gupta
  • 37
  • 1
  • 4