Unable to initiate ssh connection to Amazon EC2 instance

0 votes

I just launched an EC2 instance and I am having difficulty initiating an ssh connection. But I had a previous EC2 instance that worked fine for ssh using this same key. I am confused because i started this new EC2 instance using the same key pair.

Any expert advice on what might be going on here? And how to fix it?

Sep 5, 2018 in AWS by datageek
• 2,390 points
16 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The keypair which you are using must be either wrong or lost and there is no way you can recover the Private key pair once lost. The key is like a password and Amazon don't save the private key for security reasons.

To fix it

Go to the aws management console

1. Stop the instance and create an AMI image of the same. 2. Launch a new instance using the AMI Image created and a new key-pair attached to it. 3. Then assign the elastic IP that  was previously assigned to the old instance. 4. If everything works fine remove the old instance.

And hence forth save the XXXX.pem file somewhere online.

answered Sep 5, 2018 by Archana
• 3,770 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer

Trying to Determine Amazon EC2 instance creation date/time

You can't find as such attribute called ...READ MORE

answered May 29, 2018 in AWS by Flying geek
• 3,130 points
1,180 views
0 votes
1 answer

How to safely upgrade an Amazon EC2 instance from t1.micro to large?

Using AWS Management Console: Right-Click on the instance Instance ...READ MORE

answered Oct 8, 2018 in AWS by Priyaj
• 56,100 points
20 views
0 votes
1 answer

Unable to send email from Amazon EC2 Server in Java

It mostly could be due to two ...READ MORE

answered Nov 30, 2018 in AWS by Archana
• 5,280 points
45 views
0 votes
1 answer
0 votes
1 answer

Unable to ping to my EC2 Instance.

Make sure the Amazon network rules allow Echo ...READ MORE

answered Jan 14 in AWS by Pranjali
14 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Amazon EC2 instance unable to resolve host.

Here is my checklist of things you ...READ MORE

answered Aug 23, 2018 in AWS by Archana
• 3,770 points
234 views
0 votes
1 answer

How to add swap to Amazon EC2 instance?

A fix for this problem is to ...READ MORE

answered Sep 11, 2018 in AWS by Archana
• 3,770 points
14 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.