Possible Duplicate:
accidently ran “chown www-data:www-data / -R” as root

Just did a super duper silly mistake, while I'm not finish typing chown -R web5: client 12 / and pressed enter. Currently all the websites not accessible while most is database could not connect and no permission to execute the file. May I know how can I do a fix ? Please help. Thanks


1 Answer 1


You got ch0wned, my friend. The command should have been "sudo chown ..." and after you accidentally pressed enter, you should have said, "Oops" and not entered the password.

Well, lesson learned. Now, what to do?

Get your latest backup and dump all the files and their ownerships. Then go through them group by group and repair the ownerships. Do not reboot until you finish fixing it or you may make it much harder to repair. (You can even turn the dump into a script if you wish.)

If your system is too hosed for commands to work, you'll have to boot from a rescue CD or USB disk, mount the system, and repair things like /bin to get the system usable.

It's going to be very painful. Sorry.

Alternatively, backup the current state, restore from a working backup, and then manually restore from the backup you just made any files that aren't current in your backup.

See this answer for some tips on recovering installed system files.

  • Thx for the dawn ;) I will try it one by one and sadly I didn't make a snapshot or backup.. But may I know the default user and group of PHP, phpmyadmin, and ispconfig ? Once I get this three baby up, it should be not hard to make for the sites as they will be backed by the powerful ispconfig. thx :)
    – 1myb
    Aug 28, 2012 at 13:19
  • 1
    If it wasn't worth making a snapshot or backup of, it's definitely not worth trying to recover without one. Aug 29, 2012 at 0:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.