php - restore permissions after set by error chmod -R 775 / -
by error set folders , files permissions on 775, executing command
sudo chmod 775 -r /website/folder / and need restore server folders , paths permissions @ least centos files, moment can't send emails websites...
system centos 5
thanks...
this not meant complete solution, rather idea how solve this.
you query packet database (in centos afair rpm) , set permissions way meant according database.
some helpful commands rpm:
rpm -vaverifies files registered in rpm database. files have wrong permissions listed there. files wrong mode displayedmin 2nd column.rpm -va | grep ^.m | cut -c 13-should start.another option query files in packets with
rpm --queryformat='%{filemodes}\t%{filenames}\n' -qaand process output piping kind of loop such as
| while read mode fn; chmod -v ... "$fn"; donebut here have convert decimal output
filemodesoctalchmodunderstands it.alternatively, process output else, python script or so, gives finer control on do.
Comments
Post a Comment