Unable to access SSH for EC-2

0

We want to renew the SSL certificate for our website pokerbootcamp.in. 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.

  • Hello,

    The first thing to check is the type of keypair you are using to ssh in- PPK or PEM. You cannot use .PEM with PUTTY but you can use .PPK. In the case it is a .PEM you can still use that type of key but must instead use the terminal to ssh in.

    To create a key pair and add the public key to an EC2 instance in AWS, follow these steps: Step 1: Create a Key Pair Sign in to the AWS Management Console. Go to the EC2 Dashboard by navigating to the "Services" menu and selecting "EC2" under the "Compute" section. Step 2: Access Key Pairs In the EC2 Dashboard, locate and click on "Key Pairs" in the left-hand navigation pane under "NETWORK & SECURITY." Step 3: Create a New Key Pair Click on the "Create Key Pair" button at the top of the Key Pairs page. Give your key pair a name and select the file format. Click on the "Create Key Pair" button to generate the key pair. Step 4: Launch an EC2 Instance with the Key Pair Now, proceed to launch an EC2 instance if you haven't already done so. In the "Key Pair" step, select "Choose an existing key pair" and choose the key pair you created from the drop-down list.

    Use this documentation for guidance: https://repost.aws/knowledge-center/user-data-replace-key-pair-ec2

    For example using .pem use these lines Cd downloads ssh ec2-“username”@“123.123.12” -i ./“privatekey.pem”

    however if you wish to use .PPK keypair you need to create a new ec2 instance and download .PPK keypair so you can use it in PUTTY.

pbci
asked 2 years ago240 views
1 Answer
0

Hello

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.

or

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
profile picture
GK
answered 2 years 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