I have a website built with Codeigniter and hosted on a Linux box.
I am trying to follow "best practices" when it comes to my file permission settings, but I'm not sure if I completely understand the security implications if I set a directory to 777.
I have an images folder which is publicly accessible (it needs to be for website users to see the website images). My Codeigniter code needs to write to a a subdirectory in that folder ('images/data') occasionally.
All of my files are defaulted to 644, and my directories to 755. For the directories that Codeigniter needs to write to, I set the permission to 777.
That seems like it's too loose. Is there some way to restrict my system so that only Codeigniter is granted "write" access to those directories? I've read some stuff online about setting the owner to "apache" but as far as I can tell, I don't have an "apache" owner on my linux box. I just see root and then the website domain owner (the server hosts multiple domains, each has a "user" account).
All of my folders are defaulted to 644, and my directories to 755- folder and directories are the same thing. – Perception Oct 5 '11 at 20:00apacheuser/group, then how about awww-datauser/group. You can chown the folder to[your_username]:www-datalike this:chown [your_username]:www-data /path/to/folderand then chmod it to 774. That way only you and the www-data group have access to write to that folder. – Tom Oct 5 '11 at 20:08