Setting permissions for SFTP transfer (during transfer, not after)

Amedee Van Gasse (ub) amedee-ubuntu at amedee.be
Wed Feb 24 14:24:01 UTC 2010


On Wed, February 24, 2010 15:06, Ben Edwards wrote:

>> To have the 0660 mode, change
>> Subsystem sftp /usr/libexec/openssh/sftp-server
>> in
>> /etc/ssh/sshd.config
>> to set a umask.
>
> Thanks for that, I will have a look at the file.  Is this a umask for
> all gusers of can it be done on a user basis?

umask is normally for all users.

>> You might also need to chown and chmod g+s the directory to which you
>> are sftp'ing.

You could also touch the file before upload (size = 0 bytes); chown and
chmod; then sftp. Usable if you upload by a script, but theoretically less
secure because in theory there is an extremely small time window between
touch and chown/chmod where a malicious user could interfere.





More information about the ubuntu-users mailing list