What to do when access to your aws ec2 server is lost


What to do when your are not able to access your ec2 instance server due to incorrect configuration on your instance.


Assumptions:
  1. both servers are Ubuntu.
  2. you have to have a new instance with the same zone.

Steps:
  1. From EC2 page/menu, go to instances sub-menu, right click on the lost instance and click on stop.
  2. Go to "Volumes" sub-menu under "ELASTIC BLOCK STORE", right click on the volume of the lost instance and click on "detach volume".
  3. Right click on the detached volume, click on "Attach" then click on instance text-box and choose the new instance.
  4. ssh to the new server and mount using the command mount "e.g. mount /mnt/xvda".
  5. copy your data or fix your ssh configuration. 
  6. incase you fixed the ssh configuration on the old instance, detach the volume from the new instance and attach it to the old stopped instance.






Comments

Popular Posts