recursive command to set permission
Hi,
i want to know if is secure to use the recursive commands for assign the permissions. i have read something here time ago with security problem about recursive chown
this command can be consider safe ? i use suPhP
the purpose is to correct all files in public_html
for user in `ls -1 /var/cpanel/users | grep -v "\/"`; do find /home/$user/public_html/ -name "*" | sed 's/ /\\ /g' | xargs -n 1 chmod 644; find /home/$user/public_html/ -type d | sed 's/ /\\ /g' | xargs -n 1 chmod 755; find /home/$user/subdomains/ -name "*";find /home/$user/subdomains/ -type d | sed 's/ /\\ /g' | xargs -n 1 chmod 755;done
thanks
-
Hello, It's generally advised to avoid using recursive chown or chmod commands. For instance, it's possible a user has intentionally configured the permissions on a file/directory to something other than 0755 or 0644. Thank you. 0 -
i have read something here time ago with security problem about recursive chown
I'm guessing you're referring to this old post: Switching to suPHP That thread is still of value I think.0 -
thanks is it 0
Please sign in to leave a comment.
Comments
3 comments