Www-data user completely owns /var/www

I added another user that I could use for SFTP and then I added him to ‘www-data’ group.
Then I changed all permissions like so ( as from Ubuntu.com guide: https://help.ubuntu.com/12.04/serverguide/httpd.html ):

sudo find /var/www -type d -exec chmod g=rwxs "{}" \;  
sudo find /var/www -type f -exec chmod g=rws  "{}" \;

As a result my ‘newuser’ is able to read & write files.

But after running:
ee site create test2.com

I can’t write files with ‘newuser’ in /var/www/test2.com/htdocs’

Exposing www-data to the outside world seems less than ideal. Is there a way for ‘newuser’ to have the correct permissions when a new site is added ?

Hi, Sorry for delayed reply,
By default htdocs folder have this permission:
drwxr-xr-x 8 www-data www-data

Because of that newuser is not able to write inside that.
Inside htdocs folder use following command:
chmod -R g+w .
so that newuser having group www-data can access file inside htdocs.
Note that, now any user having group www-data can write permission for htdocs folder

Hello @justnorris ,

I hope your query is resolved. I am closing this support ticket for now.

Feel free to create a new support ticket if you have any queries further. :slight_smile: