Damia Blog

Damia English Blog

Archives

Blogroll

  • Damia Spanish blog
  • Edith Apple Blog

Recipe: How to password recovery a Linux Amazon Ec2 instance

September 14, 2010 by damia

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.

    Facebooktwitterredditpinterestlinkedinmail

    Filed Under: howto

    Archives

    • November 2016
    • December 2015
    • March 2015
    • February 2015
    • January 2015
    • December 2014
    • November 2014
    • May 2014
    • July 2012
    • September 2010
    • August 2010
    • April 2010
    • March 2010