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,440 points
44 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,090 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,160 points
2,544 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,920 points
53 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,560 points
118 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
200 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 in AWS by Pranjali
70 views
0 votes
2 answers
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
• 4,090 points
595 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,090 points
42 views