Bird
0
0

You lost your private key file for an EC2 instance launched with key pair OldKey. What is the best way to regain SSH access without stopping the instance?

hard📝 Application Q15 of 15
AWS - EC2 Fundamentals
You lost your private key file for an EC2 instance launched with key pair OldKey. What is the best way to regain SSH access without stopping the instance?
AUse the AWS console to download the lost private key again
BDelete the instance and launch a new one with a new key pair
CCreate a new key pair, then update the instance's authorized keys by connecting through Systems Manager or another user
DGenerate a new private key file with the same key name in AWS
Step-by-Step Solution
Solution:
  1. Step 1: Understand private key loss impact

    Private keys cannot be recovered or downloaded again from AWS once lost.
  2. Step 2: Regain access without stopping instance

    Use AWS Systems Manager or another user with access to add a new public key from a new key pair to the instance's authorized keys.
  3. Final Answer:

    Create a new key pair, then update the instance's authorized keys by connecting through Systems Manager or another user -> Option C
  4. Quick Check:

    Lost private key requires new key and authorized keys update [OK]
Quick Trick: Use Systems Manager to add new key without stopping instance [OK]
Common Mistakes:
MISTAKES
  • Trying to download lost private key again
  • Assuming new key pair with same name works
  • Deleting instance unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes