write permission for www-data

Jim Ohlstein jim at ohlste.in
Wed Jul 27 13:43:54 UTC 2011


On 7/27/11 9:31 AM, Adam Tucker wrote:
>  If the subdirectories were created before you chowned /home you'll need to run it recursively. For example: 
> 
> cd /home && chown -R www-data . 


This is fine if you want all of the files in /home to be writable. If
there are files that should not be writable, you can change ownership of
*all* of the directories only with:

# cd /home
# find . -type d -exec chown www-data {} \;


or

change write privileges with chmod:


# cd /home
# find . -type d -exec chmod 777 {} \;


Doing either of these can be a security risk. You should consider only
giving privileges to write to files and directories that should be
writable by the web server (like an "uploads" or "images" directory). To
do this you have to manually change them one by one.

> 
> 
> On Wednesday, July 27, 2011 at 9:27 AM, etrader wrote:
> 
>> I stored my hosts in /home. To have full functionality of my scripts I
>> gave a write permission to www-data (my nginx user) through SSH with
>> chown command. Although www-data has full permission to /home but I have
>> problem for writing in sub-folders. For example I need to give
>> individually a write permission for .home/domain/images.
>>
>> How I can give write permission to www-data fully?
>>
>> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213004,213004#msg-213004
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org (mailto:nginx at nginx.org)
>> http://mailman.nginx.org/mailman/listinfo/nginx
> 
> 
> 
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx


-- 
Jim Ohlstein



More information about the nginx mailing list