Question
Permission denied writing files through sftp
I have a droplet running ubuntu 14.04 and a LEMP stack. I have subdomains on the /var/www folder with each having its own folder inside /www. I have one user with root permissions that is the one that I use for ssh and sftp. When I trie to write the file via sftp I have permission denied.
All the folders have 755 and the file have 644.
What do I need to change to get it working?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
you could try this:
make sure your user is a member of the www-data group:
then give group permissions:
@sierracircle - Apologies for the nitpick. I know you need exec for directories to look inside, but why give exec permissions for all files in /www or /var/www?
Try it, and if that works for you then use that. Better to have as strict permissions as possible.
In this case, I was suggesting a quick way to be able to edit files. Did that work?
@sierracircle it didn’t work but after I deleted the file and uploaded one from my computer it worked.