Possible Duplicate:
Accidential CHMOD 755

Like other questions lurking around here, e.g. this one and another, I've made a boo-boo. Specifically, I ran a command, in /, while rooted, like so:

chown -R 770 x:x *

Where x was apache (I think! Maybe I was experimenting with nobody, or somebody else). Similar to others I almost immediately noticed and killed the job but it seems too little too late.

My problem diverges from the existing ones at the point that I was setting selinux to permissive and stupidly decided to reboot "to prove it". Now I can't boot - the screen remains black while the cursor is a constant loading animation post-GRUB selection.

I've tried booting into 'recovery mode' which sounds hopeful though loses its promise when I follow the instruction to return to default mode (naturally) since (probably among other reasons) "etc/audit/somethingOrOther is not owned by root" and I'm back to perpetual loading.

Obviously I need to fix the system before returning to default mode. Can this be done from the recovery console (preferably easily)?

This isn't my day to day system and I don't have backups; it's been set up for a very specific, rare purpose and it's not the end of the world (there is no valuable data lost with it, if it's a lost cause), I was just hoping to proceed with what I was doing today.

marked as duplicate by Tom O'Connor, voretaq7 May 21 '12 at 16:08

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.

  • 2
    Can you load another linux (eg knoppix) from CD or USB key and chroot in? – rackandboneman May 21 '12 at 16:02
  • This question has been asked many times before: serverfault.com/questions/233764/revert-chmod-777-r , serverfault.com/questions/180155/undoing-chmod-777 , etc. -- there's even a back-story question on why it's bad: serverfault.com/questions/364677/why-is-chmod-r-777-destructive - If the dup doesn't answer your question search for "chmod 777" using the box in the upper-right-hand corner. – voretaq7 May 21 '12 at 16:07
  • @rackandboneman I haven't tried; currently rolling past work hours so will need to look at this when home - it's not a physical machine, though, it's virtualboxed so will need to figure that out (if the different matters much). – Grant Thomas May 21 '12 at 16:09
  • @voretaq7 One noted difference is that I rebooted and I'm not in the system any more. Most other answers provide commands to run, which I might be able to run successfully from the recovery console, but I've been cavalier enough for one day. – Grant Thomas May 21 '12 at 16:09
  • @Mr.Disappointment Any of the methods proposed in the various duplicates can be tried from recovery mode or a boot disk, however the best answer to your question (as found on all of the questions about this issue) is to reinstall. You've done substantial damage, and it cannot be easily reversed (all the methods described just take care of stuff handled by package management systems, not user files, manual installs, etc.). I'm sorry if that's not the answer you wanted to hear, but it's the right one. – voretaq7 May 21 '12 at 17:28

You can boot from a Fedora CD in rescue mode. Then mount your partitions in a rescue folder. Mount with bind option /dev/ /sys and /proc, then chroot into the rescue mount folder. Run rpm -Va to find all files that have the wrong ownership.

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