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.
-
possible duplicate of How to put desired umask with SFTP?– quantaOct 7, 2011 at 6:59
-
"but it is not fit for me as client may upload file with 664 permissions." --> what do you mean?– quantaOct 7, 2011 at 7:00
-
umask just help you mask the client upload files' permissions like (0777 -> umask 0022 -> 0755).– frankyueOct 7, 2011 at 7:04
-
But I want to set all files permissions like (chmod 644 upload_file)– frankyueOct 7, 2011 at 7:07
-
You want 775 or 644?– quantaOct 7, 2011 at 7:10
|
Show 4 more comments
1 Answer
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
.