Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.