By error I set all folders and files permissions on 775, executing this command
sudo chmod 775 -R /website/folder /
And now I need to restore all the server folders and paths permissions at least centos files, by the moment I can’t send emails from my websites…
System is centos 5
Thanks…
This is not meant as a complete solution, but rather as a idea how to solve this.
You could query the packet database (in CentOS it is AFAIR RPM) and set the permissions the way they are meant to be according to that database.
Some helpful commands for RPM:
rpm -Vaverifies the files registered in the RPM database. Files which have the wrong permissions are listed there. Files with the wrong mode are displayed with aMin the 2nd column. So something likerpm -Va | grep ^.M | cut -c 13-should be a good start.Another option could be to query all files in all packets with
and process the output by piping it into some kind of loop such as
but here you would have to convert the decimal output from
FILEMODESto octal so thatchmodunderstands it.Alternatively, you could process the output with something else, like a python script or so, which gives you much finer control over what you do.