EC2 lost key pairs

0

I did something six months ago on an EC2 instance. I've tried all the steps about 30 times and gave up. I have tried by edit user data and also using AWSSupport-ResetAccess. I have just tried again and noticed the error output on AWS Systems Manager. Can anyone help please? What can I do? Here is the output... Locating rescue device Mounting rescue volume /dev/nvme1n1p1 unlink /mnt/mount/etc/resolv.conf '/etc/resolv.conf' -> '/mnt/mount/etc/resolv.conf' removed '/mnt/mount/usr/bin/ec2rl' '/mnt/mount/usr/bin/ec2rl' -> '/usr/local/ec2rl-1.1.6/ec2rl' Generating new key pair Starting chroot Error: execution failure inside chroot environment.

The EC2Rescue execution did not complete successfully. removed 'etc/resolv.conf' umount: /mnt/mount/sys (sysfs) unmounted umount: /mnt/mount/dev/pts (devpts) unmounted umount: /mnt/mount/dev/pts (devpts) unmounted umount: /mnt/mount/dev/shm (tmpfs) unmounted umount: /mnt/mount/dev (devtmpfs) unmounted umount: /mnt/mount/proc (/proc) unmounted umount: /mnt/mount (/dev/nvme1n1p1) unmounted

----------ERROR------- chroot: failed to run command '/bin/bash': No such file or directory

asked 2 years ago322 views
1 Answer
0

Hello,

Just checking, have you referenced this article? There are 4 methods outlined there. I see you have tried 2 of them already. Can you consider exploring the other 2?

[+] How can I connect to my Amazon EC2 instance if I lost my SSH key pair after its initial launch? - https://aws.amazon.com/premiumsupport/knowledge-center/user-data-replace-key-pair-ec2/

It does have a video recording you can reference - https://youtu.be/5V2hKFj9_SI

AWS
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