Restore default system file & folder permission on Linux : using -setperms and --setugids

We can recover or restore the default file / folder permission and ownership using rpm command with the options -setperms and --setugids.  

This will help system admin to recover file permissions in easy way. But the below command will take time to change the permission for entire system files and directories. But you have to tolerate ....

This is very useful option which i found in RPM command.

1) To reset uids and gids on files and directories :

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


2) To permissions on files and directories

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




1 comments:

Post a Comment

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks