While I was setting up an Ubuntu server (EC2), I accidentally run the following:

sudo chown -R www-data.www-data /*

Anyway, is there an easy way to restore all the original file permissions?

I am not sure whether I should spend the time fixing this, or simply create a new ec2 instance and start from scratch. I am fairly early in the set up process so it might be the faster option.

  • This, and variations on the same theme, seems to be a very popular thing to do.
    – Kusalananda
    Commented Jul 24, 2016 at 22:04

1 Answer 1


I don't think there is any faster way. You could come up with a script that copies the ownership info from a working installation, but writing the script would probably take more time than creating a new instance and starting from scratch.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .