Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an sftp-server and need to set all files' permissions to 775 which upload from client.How can I do that? Just found the umask set,but it is not fit for me as client may upload file with 664 permissions.

share|improve this question
possible duplicate of How to put desired umask with SFTP? – quanta Oct 7 '11 at 6:59
"but it is not fit for me as client may upload file with 664 permissions." --> what do you mean? – quanta Oct 7 '11 at 7:00
umask just help you mask the client upload files' permissions like (0777 -> umask 0022 -> 0755). – frankyue Oct 7 '11 at 7:04
But I want to set all files permissions like (chmod 644 upload_file) – frankyue Oct 7 '11 at 7:07
You want 775 or 644? – quanta Oct 7 '11 at 7:10

And how can I set to make all files to 775 whatever the client upload?

You cannot.

Resulting permission = Default permission AND (NOT umask)

With file:

default permission = 666 = 110 110 110
umask                    = whatever
resulting permission     = xx0 xx0 xx0

In summary, you cannot create an executable file using umask.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.