How do you connect via SSH to a Linux EC2 instance with an EBS volume if you lost your key pair?

  • Stop the instance and create an AMI image. Launch the image using a new key pair.
  • Contact AWS support. A support specialist can remotely restore access to your instance and send you a new key pair.
  • You can not connect to this EC2 instance. The key pair is displayed only one time. If you lose it, you have lost all access to this instance. Connect the EBS volume to another instance to recover your files.
  • Attach the EBS volume to a temporary instance launched with a new key pair, and overwrite ~/.ssh.authorized_keys using the same file from the new instance.
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment

Share via
G Certification Course We would like to show you notifications for the latest news and updates.
Dismiss
Allow Notifications
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend