Rsync file ownership / permission issue when sync'ing with root whereas remote webserver use nginx user on files

8 views
Skip to first unread message

Benjamin A

unread,
Apr 27, 2023, 4:10:48 AM4/27/23
to DropSync
Hello,

I'm using root user SSH access to sync between my local folder and my webroot and vice-versa.

The problem is that my webserver expect (for security) all webroot items to have permission for the "nginx" user instead of root.

It seems like everytime I use DropSync from Local to remote Webroot the permissions are not set as they should... i.e. nginx user looses the ability to edit the files.

So the only solution I have is to manually run this on the VPS:

chown -R nginx:nginx /home/nginx/domains

to have the webroot permissions reset as they should for the nginx linux user...

Any idea or workaround to set this automatically?

Thank you,

ira cooke

unread,
Apr 27, 2023, 8:11:54 PM4/27/23
to DropSync
Hi Benjamin,

This is an interesting question.  Unfortunately I don't know a way to resolve it.  Rsync can preserve permissions or customise permissions but doesn't have an option to modify the owner at the receiving side. 

I think you have found the best workaround?  

Sorry to bring bad news.
Ira
Reply all
Reply to author
Forward
0 new messages