I know they say that given root access, someone will eventually type before they think and fubar their machine, and I just did.
I did a recursive chmod changing everything to 775 thinking I was in a sub directory, but alas, I was in /. Is there any magical way to undo this, or at the very least, get a list of default directory permissions and manually restore them?
I have exact same problem.
fixed the problem.
If your distribution is rpm based, the rpm database contains permission information. The command
should reset the permission for the given package.
There's no undo. Beyond installing a box with similar unix, and scripting something to check everything permissions, I don't believe there's a list of default permissions either. Not very helpful, unfortunately.
To amend the "rpm --setperms" information, that will allow you to fix the permissions of all files and directories which were installed as RPM packages. It will NOT fix the permissions of files that were installed without using RPM.
You can get a list of all the installed packages by doing "rpm -qa", for use in feeding to the "rpm --setperms". You can also use "rpm -Va | less" to have RPM do an integrity check on all installed files and directories to allow you to do more fine-grained adjusting of permissions -- it will report if the file contents, modes, and times have changed, and whether the file is a configuration file or not.
Sean