Imagine you have an Amazon Ec2 instance, and you miss your ssh keys, and passwords. How can you execute a password recovery? That is easy, mount your disk on other machine to do that. First a t all you need and EBS root instance.
Stop the machine
Detach the volume from machine
Create a new machine on the same availability zone, for example a micro instance with fedora, an start it
Attach the volume to it, for example on /dev/sdh. Don’t use the elasticfox, I don’t know don’t work for me, use the aws web.
Mount the disk, change passwords, add ssh key, or any recovery action you need
Unmount the partition
You could terminate this instance is no longer needed
Attach the partition, to the same machine, don’t use the elasticI don’t know don’t work for me, use the aws web. IMPORTANT Attach to /dev/sda1.
Start the instance
That’s it, you have your instance recovered.



