1

I have a ubuntu 18.04 server running on GCP (nginx+php7). I've setup a directory /var/www/mysite.com which is drwxr-xr-x www-data:www-data. public_html/ is also drwxr-xr-x www-data:www-data.

I'm using the following command to try to rsync the files to the directory (for automated deployment):

rsync -azvp test/ me@xx.xxx.xxx.xxx:/var/www/mysite.com/public_html/test/

However, when I do this, I get the following error:

rsync: mkdir "/var/www/mysite.com/public_html/test" failed: Permission denied (13)

I've checked groups of the me user and it is part of the www-data group.

Why am I still getting permission denied even though i'm part of the www-data group? I'm starting to wonder if I'm even using the correct group for what i'm trying to do.

Thanks for any help!

David
  • 119

1 Answers1

3

Group www-data does not have write permission.

( you state it has permissions drwxr-xr-x www-data:www-data )

You need to (at least) give write permission to this group (sudo --user www-data chmod -R g+w /var/www/mysite.com).

In addition I would consider using file access control lists (with default permissions), to ensure that group www-data retains access. see What are the different ways to set file permissions etc on gnu/linux for more info on this.