If an AWS EC2 instance is launched and for some reasons the key-pair is lost. What is the next step?? Let us see how to restore the lost key pair in this blog post
Pre-requisites:
- AWS login access
- Permissions to create EC2
Getting Started:
- Login to the AWS EC2 Console Page
- Stop the EC2 instance for which the key pair is lost; below is the EC2 for which the Keypair is lost now and hence stopped to detach volume based on InstanceID
- Gather the EC2 instance ID, go to Volumes Page, locate the instances' volume and detach the volume
- Attach the volume to the newly created EC2-with-kp instance;below is the instance for which keypair is available
- SSH to new EC2 to copy new key pair to the volume just attached; to update the ~/.ssh/authorized_keys in the mounted volume(from EC2-wo-kp)
- Now we can ssh to this EC2 instance using new key pair
Happy Recovery !!
No comments:
Post a Comment