I have a subdomain for different projects in the path / var / www / subdomain / public_html
sub.dominio.com/proyectoA
sub.dominio.com/proyectoB
sub.dominio.com/proyectoC
I have two users on the server (root and userA), in order to upload and edit the template files I use the userA through SFTP. Assuming I have to create a new project, I have to connect by ssh
$ cd /var/www/subdominio/public_html
$ mkdir proyectoD
$ cp -r wordpress/* proyectoD/
For the wordpress to install plugins I have to run
# chown -R www-data:www-data proyectoD
But to be able to edit the files of the theme I have to execute
# chown -R usuarioA:www-data proyectoD/wp-content/themes
Is there a way that you do not have to change the owner of the directory every time you create a new project? You just have to create the folder and copy the contents of the wordpress.tar.gz in the new directory.