Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

marked as duplicate by quanta, Khaled, mulaz, Iain Aug 28 '12 at 11:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
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 '12 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. –  David Schwartz Aug 29 '12 at 0:29

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