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,540 points
861 views

1 answer to this question.

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
• 4,170 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,280 points
9,791 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
• 58,020 points
1,164 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,640 points
1,333 views
0 votes
1 answer

Getting connection timed while connecting to my EC2 instance

Due to some technical difficulties on the ...READ MORE

answered Dec 14, 2018 in AWS by Aniket
2,135 views
0 votes
1 answer

Unable to ping to my EC2 Instance.

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

answered Jan 14, 2019 in AWS by Pranjali
1,763 views
0 votes
2 answers
0 votes
1 answer

Permission denied when I SSH access to EC2 instance

These are common reasons that can cause ...READ MORE

answered Mar 12, 2019 in AWS by Reema
2,060 views
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
• 4,170 points
6,015 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
• 4,170 points
657 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP