-1

I just did something really dumb and I'm wondering if there's any way to reverse it. So I have an AWS EC2 server instance and I was trying to edit the php.ini in /etc. It kept telling me that I didn't have permissions to write to it, so I just thought, "Okay, well nobody's ever really going to see this site, I'll just chmod everything." So I did chmod -R 750 ... I know... I know... What was I thinking. So now it messed everything up and I can't SSH in with my ec2-user login anymore... Is there any way to fix this or did I just permanently wreck it?

brycejl
  • 1,411
  • 17
  • 22

1 Answers1

1

If you are using an EBS backed instance, you can recover the SSH access doing this:

  1. Stop your crashed instance
  2. Detach the EBS root device
  3. Create a new instance
  4. Attach the EBS to the new instance and mount it in /mnt
  5. Fix your file permissions in /mnt/home/user/.ssh
  6. Unmount and detach the EBS
  7. Attach it to the crashed instance and start it

You should have ssh access, but note this won't fix all crashed files or directories. It only will give you ssh access, then you have to fix your files permissions. Otherwise, you do this in step 5.

Luck!

AGL
  • 536
  • 2
  • 7