I am running the openssh sftp server like so:

Subsystem       sftp    /usr/libexec/openssh/sftp-server -u 002

And the folders I upload via sftp get these permissions:

drwxrwxr-x 12 developer staff  4096 Dec 10 13:20 one
drwxrwxr-x  4 developer staff  4096 Dec 10 13:20 two

so far so good. However, uploaded files are not getting the right permissions:

-rw-r--r--  1 developer staff  1406 Dec 10 13:20 favicon.ico
-rw-r--r--  1 developer staff  298  Dec 10 13:20 settings.json

I am connecting to the sftp server as the developer user with a script, so no permissions are being set by the client. Additionally, I have umask 002 in the developers ~/.bashrc.

I need the group to have write permissions to uploaded files.

Any idea on why this is not working?

Note: if I remove the -u 002 flag from the sftp Subsystem, the folder permissions are rwxr-xr-x, which tells me that the -u flag is working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.