By using AWS re:Post, you agree to the Terms of Use
/Unable to access SSH for EC-2/

Unable to access SSH for EC-2


We want to renew the SSL certificate for our website The site is hosted on EC-2. I just installed PUTTY to access SSH but we don't have the keypair. Tried creating a new one but that gets refused on PUTTY. Is there a solution to this? We just want to renew the SSL, that's it.

asked 6 days ago5 views
2 Answers


If you lose the key pair to connect the Ec2 instance, It is not possible to connect but you can create new key pair and use this solution in this case you must STOP the instance.


if you do not need to stop the machine you can create AMI from the Ec2 instance and create New EC2 with different Key pair

  1. Create AMI from the running Ec2 with No reboot
  2. launch Ec2 from the AMI you have created just now in the last step choose create Nee Key pair
  3. If you have EIP you can disassociate and associate with NEW EC2
answered 6 days ago

More information on how to gain access to an EC2 is you have lost the SSH private key:

I've lost my private key. How can I connect to my Linux instance?

It is important to keep your SSH keys at a secure place, please see below blog on how you can leverage AWS Secrets Manager to securely store and rotate SSH key pairs

How to use AWS Secrets Manager to securely store and rotate SSH key pairs

answered 6 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions