How do I change the key pair for my ec2 instance in AWS management console? I can stop the instance, I can create new key pair, but I don't see any link to modify the instance's key pair.
Amazon-web-services – Change key pair for ec2 instance
amazon ec2amazon-web-serviceskey-pairssh
Related Topic
- Amazon-web-services – Add Keypair to existing EC2 instance
- Amazon-web-services – SSH to Elastic Beanstalk instance
- Amazon-web-services – scp (secure copy) to ec2 instance without password
- R – “UNPROTECTED PRIVATE KEY FILE!” Error using SSH into Amazon EC2 Instance (AWS)
- Amazon-web-services – Downloading an entire S3 bucket
- Amazon-web-services – Cannot ping AWS EC2 instance
Best Answer
This answer is useful in the case you no longer have SSH access to the existing server (i.e. you lost your private key).
If you still have SSH access, please use one of the answers below.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#replacing-lost-key-pair
Here is what I did, thanks to Eric Hammond's blog post:
/dev/xvda1
volume (let's call it volume A) - see here/dev/xvdf
(or/dev/sdf
)/mnt/tmp
~/.ssh/authorized_keys
to/mnt/tmp/home/ubuntu/.ssh/authorized_keys
/dev/xvda
.pem
fileThat's it.