0
votes

I was using the AWS EC2 to host websites under apache then I made a huge mistake... I tried to change a user group of a folder (to www-data) but instead of this I've changed the entire system user group.

My mistake was a "sudo chown -R www-data:www-data /"

So I lost root access and now almost everything stop to work. I can't even login to SSH anymore.

Is there a way to restore those permission?

1

1 Answers

0
votes

You need some way to stop the VM, mount the partition on another VM, and chown -R root:root /mnt (or wherever). Then you'll at least be able to get the thing back online and fix the rest; the easiest way to do this is probably to re-install all the Ubuntu packages.

Personally, I would take the opportunity to automate setting up a VM -- so that if anything like this happens again, re-creating the whole thing from scratch is just a command away.