Fix File Ownership and Permission Issues in cPanel
The following commands will fix ownership and permission issues for a cPanel account. Replace test with the actual cPanel username.
chown test:test /home/test/public_html/* -R
for i in `find /home/test/public_html/* -type f`; do chmod 644 $i; done
for i in `find /home/test/public_html/* -type d`; do chmod 755 $i; done
chmod 755 /home/test/public_html/cgi-bin/ -R
chown test:test /home/test/public_html/* -R
These commands reset file and directory permissions to their recommended secure defaults and ensure correct ownership for the cPanel user.