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 *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...