-1

accidently I did "chown -R www-data:www-data /" (I wanted to chown current directory).

Is the only good way now to set the system up again from beginning?

waaaah -.-

Thanks

bagbag
  • 31
  • 1
  • 3
  • 1
    Reinstalling will certainly be the _fastest_ way to recover. Related: [Why is “chmod -R 777 /” destructive?](http://serverfault.com/q/364677/126632) – Michael Hampton Jul 07 '14 at 16:07
  • This appears to be a dup of http://serverfault.com/questions/105957/accidently-ran-chown-www-datawww-data-r-as-root . Your question doesn't really have enough info to answer the question. Which OS and/or distro are you running. RPM and .deb based distributions usually have a data base that contains information about all the files, ownership and permissions. Solaris exposes this information in text files. Source based distros or systems with many manually installed packages may be a bit more challenging. – Rik Schneider Jul 07 '14 at 16:15

1 Answers1

0

In a world of total automation, it is so much easier to replace something that's broken than to try to fix it. That's why you just buy a new toaster when the old one's broken -- more cost effective that way.

It's a hard situation, but in the future, I'd use a configuration management tool like salt or puppet. That way, if your server goes down or an accident like this happens, you can just tell salt or puppet to reinstall from the beginning, and -- poof! -- you have your old server back, with all its custom config and files in place where they should be. replace your old toaster with one fresh off the assembly line.

djhaskin987
  • 388
  • 4
  • 14