Change file permissions on all files with a certain name
Hi. Is there way I can change all file permissions on a certain file name easily (without doing them 1 by 1)? Eg search /home and change all files found that match "wp-config.php"
We have a vps with 40+ wordpress installations and want to change all the wp-config.php permissions to 400.
Thanks
-
Before I tell you how to do this, I'll just state that it's basically useless from a security standpoint if you want to do it with wp-config files. In most cases if you use SuPHP (which most people do) the sites user still owns the file, and a hack script can still access the file, or change its permissions back to writeable. Anyway, it's a simple find command, but standard caveats of root shell access apply. # find /home/*/public_html/ -type f -name wp-config.php -exec chmod 400 '{}' \;0 -
Hello :) In addition to the previous thread, if you are looking to improve overall security, check out the cPanel Security Advisor for some useful tips: "WHM Home " Security Center " Security Advisor Thank you. 0 -
Thanks for that quizknows, it worked. :) CpanelMichael - Thanks, but yes i've done that. 0
Please sign in to leave a comment.
Comments
3 comments