Reset the File Permissions on a Fedora Machine

Written by James McDonald

August 14, 2011

Just recently I discovered a problem caused by a trial software install. Files in /usr had been changed to be owned by someone other than root. (postgres).

I did try to fix the problem by running chmod root:root /usr -R

But I’m not confident that everything is now correctly owned.

Because it’s an RPM packaged system I can use rpm to help with resetting ownership (–setugids) and permissions (–setperms) as follows:

rpm -qa | xargs -IFILE rpm --setugids --setperms FILE

The command basically says query the rpm database (-q) for all installed packages (-a) pipe the list of packages to xargs and run rpm with the –setugids and –setperms flags set on each package to fix up it’s perms.

If you run the above you will see alot of “No such file or directory” messages.

Note: Do the above at your own risk.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like…

How to Research a CPU Upgrade

How to Research a CPU Upgrade

Upgrade Time! Doing a lot of VMWare Workstation virtualization to create labs for self-study and training. Finding...