I have ubuntu server and have ‘www-data’ group and user. This user starting Apache and WordPress operations.
And i have SFTP ‘username’.
‘username’ added to ‘www-data’ group.
For my site root directory i running:
chown -R www-data:www-data /home/myuser/site
chmod -R 02775 /home/myuser/site
chmod -R g+w /home/myuser/site
I can edit and move files from SFTP.. All is ok.
But i can’t edit new wordpress plugins, because WordPress creating folders and files with chmod 755.
For fix it, I must to re-execute command:
chmod -R g+w /home/myuser/site
How i can fixit as default?