How to connect to AWS EC2 instance if lost SSH key pair

0

Hi,

Lost SSH private key to access production web server. After google result, I tried to follow two method with the following link at https://aws.amazon.com/premiumsupport/knowledge-center/user-data-replace-key-pair-ec2/

But both method 1 and 2 not work at all. Could you please help to figure out?

Method 1: Enter user-data. After config completed, using SSH and server refused the public key Method 2: Use AWS Systems Manager. Unable to find runbook called AWSSupport-ResetAccess in Automation runbook

Roy

  • If you don't have constraints about turning off the instance, i would suggest that you create an image from the instance, and then create the instance from the image

질문됨 일 년 전1031회 조회
3개 답변
1
수락된 답변

You can find step-by-step instructions in the EC2 User Guide under the Troubleshooting topic "I've lost my private key. How can I connect to my Linux instance?". https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#replacing-lost-key-pair

AWS
답변함 일 년 전
1

Another method is to stop the instance; then mount the instance volume on another instance (you only have to run the second instance temporarily); replace the key file; then restart the first instance.

Here are some instructions - note that this is an external link; the content isn't produced by AWS: https://www.cloudtechtiq.com/blog/how-to-recover-key-file-aws-instance

profile pictureAWS
전문가
답변함 일 년 전
0

Which AMI are you using?

profile picture
답변함 일 년 전

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

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

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

관련 콘텐츠