Back to all articles Amazon Web Services

How to Access EC2 Instance even if PEM File is Lost

# mount /dev/xvdf1 /mnt
# cp /root/.ssh/authorized_keys /mnt/root/.ssh/
# umount /mnt
  1. Detach the secondary volume from helper instance. 
  2. Again attach the volume back to our recovery instance. Start the instance. Terminate the helper instance.

Use helper instance pem file to log into recovery instance.

Share this article

Need Expert Development Help?

Our team specializes in the technologies covered in this article. Let's discuss how we can help with your project.