How to set default group permissions for SFTP download?

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 recently downloaded files accept a group name that matches the username (i.e. Their main group).

Is there a way to change this default group assignment to www data in SFTP? At the command prompt, you can enter:

$ newgrp www-data p>

Assigning the current user primary group to www data. All new files created by the user are assigned to this group. Is there an SFTP equivalent?

+4
source share
2 answers

Setting the setgid directory means that the files created in it will become part of the directory group.

mkdir web chgrp www-data web chmod g+s web 
+12
source

You may need an additional umask installation step before starting the server process:

 umask 0002; /usr/lib/openssh/sftp-server 

Or in sshd_config, "you can pass the flag and value to (-u 0002) as follows to set the umask value:"

 Subsystem sftp /usr/lib/openssh/sftp-server -u 0002 

Read this: http://john.parnefjord.se/node/62

+4
source

Source: https://habr.com/ru/post/1313701/


All Articles