How to restore remote access to a RHEL system from expanded permissions set over the entire filesystem? [duplicate]

For files that are part of a package, you can find out what was messed up by doing

rpm --verify "packagename"

where packagename is an individual package, or you can loop through the output of "rpm -qa"

Then you should be able to use rpm to fix them with something like

rpm --setperm "packagename"


The issue with ssh is most not limited to just under /etc and also has to do with the .ssh folder of the user you are trying to connect with having improper permissions. Generally the .ssh folder for a user should be 700, private keys should be 600, and everything else can be 644.

The /etc/ssh folder should be 755, under /etc/ssh the private keys should be 600, and everything else should be 644.

Howto recover a server from bad permissions in /etc?

Possibly one of the easiest methods might be to restore from your backup. You do make backups and have tested the restore procedures right? :)

If you don't have a backup that you can use to do a restore from, you may need setup a clean system that is identical in a VM and then fix the permissions on the host based on your server by comparing the two.