views:

14

answers:

1

I am connecting to a web server running Debian. Our team uses Apache and all users are members of the www-data group. When we connect to this server via SFTP (e.g. Transmit), all of our newly uploaded files take on a group name that is the same as the user's name (i.e. their primary group).

Is there a way to change this default group assignment to www-data on SFTP? On the command line, one can type:

$ newgrp www-data

Which assigns the current user's primary group to www-data. All new files created by the user are assigned to this group. Is there an equivalent for SFTP?

+1  A: 

Setting a directory setgid means that files created within it will acquire the directory's group ownership.

mkdir web
chgrp www-data web
chmod g+s web
Ignacio Vazquez-Abrams