Skip to main content

Change file permissions on all files with a certain name

Comments

3 comments

  • quizknows
    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
  • cPanelMichael
    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
  • felixr
    Thanks for that quizknows, it worked. :) CpanelMichael - Thanks, but yes i've done that.
    0

Please sign in to leave a comment.