Adding files with sFTP to /etc/shared/nginx/html changes group to myname:myname

August 28, 2014 4.7k views

After creating a LEMP on Ubuntu droplet, I added two users to the sudo group, to give my colleague (hisname) and I (myname) admin rights on the droplet. After this, I changed the ownership of the /etc/shared/nginx/html folder to myname:sudo and set the permissions to 775.

sudo chown -R myname:sudo /etc/shared/nginx/html
sudo chmod -R 775 /etc/shared/nginx/html

The idea behind this is that multiple people should be able to change the production website. So, as long as they were part of the sudo group, they would be able to change the website.

However, when my colleague connects to the droplet with sFTP (client: Transmit), and adds the appropriate website files, all ownership and permissions are changed to hisname:hisname. This means that I can’t alter any of those files.

We’re not sure whether this is something that is configured in the sFTP client, or on the droplet itself. Does anyone know how I can make sure that files changed/added by the sFTP client are set to user:sudo with 775?

1 comment
  • Can’t seem to answer my own question in the answer field, so I’ll add a comment instead.

    I solved it by using an ACL (Access Control List) as described in the top-voted answer in this answer:

    I used this answer to avoid having to alter the umask for every new user that I created.

1 Answer
Have another answer? Share your knowledge.