Can I Connect to My EC2 Instance After Deleting the Key Pair?

0
7
Asked By SkyHigh9000 On

Hey folks, I lost my private key (.pem file) for an EC2 instance and I'm worried since SSH access usually relies on that key. However, I noticed that even after deleting the key pair from the AWS console, I could still connect to my instance using features like EC2 Instance Connect or Session Manager. I'm curious about the impact of deleting a key pair on existing instances. Does it affect anything, or is it just about new instances? Any advice or experiences would be super helpful!

1 Answer

Answered By TechSavvyGator On

Deleting a key pair won't affect your existing instances; it’s mainly just metadata for new ones. When you created your instance, the key was written to the authorized keys file at that time, but it's not linked to future instances. Using Session Manager (SSM) is a good alternative for access without worrying about the key pair.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.