thinking out loud…

…ramblings of Peter Amiri

Fixing cPanel file permissions

February 12, 2013 | Comments Off

Just for my own note
After installing suPHP on server, execute :

find /home/*/public_html -type d -exec chmod 755 {} ;

This command fix all folder permission

find /home/*/public_html -name '*.php' -o -name '*.php[345]' -o -name '*.phtml'| xargs chmod -v 644

This command fix all file permission

#!/bin/bash
cd /var/cpanel/users
for user in *
do
chown -R $user.$user /home/$user/public_html/*
done

This script fix all ownership issue