How to reset the OS back to the base permissions and uid/gids

If your system have been compromised RedHat has a way to reset the OS back to the base permissions and uid/gids.

This is how you do it.

Resets uids and gids on files and directories:

for i in $(rpm -qa); do rpm --setugids $i; done

Resets perms on dirs & files:

for i in $(rpm -qa); do rpm --setperms $i; done

I am a Senior System Administrator that work daily with Virtualization,Xenserver, Linux, IT automation, Ansible,Windows, Active Directory, Exchange and a lot more. Here you will find tips and trix from early junior, middle junior and senior to unique information of the topics I mentioned earlier. If you need help with something do not hesitate to contact me I will gladly help.

Tagged with: ,