/ Published in: Bash

This will grep through your file structure (LAMP stack assumed) and change directories and files to the correct permissions to work with suPHP.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
for i in $(find /home/*/public_html -maxdepth 0); do u=$(echo $i | awk -F '/' '{print $3}') && chown -R $u:$u $i; done for i in $(grep DocumentRoot /usr/local/apache/conf/httpd.conf | awk '{print $2}' | grep -v /usr/local/apache/htdocs); do chgrp nobody $i; done find /home/*/public_html -type d -exec chmod 755 '{}' ';' find /home/*/public_html -type f -exec chmod 644 '{}' ';' find /home/*/public_html -iwholename '*.cgi' -exec chmod 755 '{}' ';' find /home/*/public_html -iwholename '*.pl' -exec chmod 755 '{}' ';'
Comments
