Nov
17
This is a nice little script that I use to clean up files and directories with poor permissions. Its great to use in preparation before installing mod_suPHP/PHP suexec.
#!/bin/bash
# Make sure all files are owned by the correct user. Get rid of file owned by nobody
for i in $(ls /home| cut -f1 -d/); do chown -R $i:$i /home/$i/public_html/*; done
# Find all files that are 777 and change them to 644
for i in $(find /home/*/public_html -perm 777 -type f); do chmod 644 $i; done
# Find all directories that are 777 and change them to 755
for i in $(find /home/*/public_html -perm 777 -type d); do chmod 755 $i; done

December 12th, 2007 at 11:37 am
Hey,
I’m having this problem with one of my accounts, bassically it’s an image upload website, and someone uploaded porn and I tried to delete it, but I couldn’t, it said I didn’t have permission to! — so I just renamed it for time being, but these files (images) don’t seem to have writable names ;; which is why I think I cannot delete them!
December 12th, 2007 at 9:29 pm
You will probably want to verify the permissions and ownerships of the file. Also, be mindful of what user you are logged in as. If you’re still having trouble, I would suggest submitting a support ticket.