I lost my SSH key and can't access my EC2 server

0

I lost my original SSH key and now can't connect to my server. I'm using the WordPress certified by Bitnami AMI.

Would you please help me access the server? What is the best way?

I tried connecting to the instance directly from the console and also editing user data with a new public key and wasn't successful in any of them. Also, I can't create a new instance in the same zone to somehow detach and reattach the volume. Would you please help?

질문됨 10달 전428회 조회
4개 답변
0

Hi, here is the guidance to recover access to your EC2 instance: https://repost.aws/knowledge-center/user-data-replace-key-pair-ec2

Fingers crossed! Didier

profile pictureAWS
전문가
답변함 10달 전
profile picture
전문가
검토됨 10달 전
0

Hi.

Maybe this guide can be helpful.

profile picture
전문가
답변함 10달 전
0

The edit user data did not work for me. I was gonna try the AWSSupport-ResetAccess but I'm afraid it affects my data on the instance

답변함 10달 전
0

Hello,

This may help if it's EBS backed https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#replacing-lost-key-pair

Another option,

If it's an AMI, it may have the option for Session Manger as well. As long as it has the correct SSM role, you may be able to log into the server and update the public key there. I've added the steps below, if you are able to log into the server.

  1. Create a new key pair using the Amazon EC2 console or a third-party tool.
  2. Retrieve the public key from your new key pair. For more information, see Retrieve the public key material.
  3. Connect to your instance using SSM.
  4. Using a text editor of your choice, open the .ssh/authorized_keys file on the instance. Paste the public key information from your new key pair underneath the existing public key information. Save the file.
  5. Disconnect from your instance, and test that you can connect to your instance using the new private key file.

(https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html)

AWS
답변함 10달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠