I'm running vsftpd
and have a specific question:
The file_open_mode
and local_umask
options let me configure, what permissions a newly created file/folder should have.
The problem:
I want 0660 for new files but 0770 for new folders (All files and folders should be readable and writable by owner and group – folders need the executable
bit so that it's possible to open them)
How can I configure that?
(I searched this forum, google, vsftpd.man page, tutorials, manuals..)
Best Answer
TL;DR:
The default
file_open_mode
of0666
andlocal_umask
of0007
will give you file permissions of0660
and directory permissions of0770
.File permissions
As you already pointed out, files are created with the permissions set in
file_open_mode
(modified by thelocal_umask
). Therefore, to get files created with0660
you can keep the defaultfile_open_mode
and modify it with alocal_umask
of0007
to get0660
as the result.Directory permissions
Directories are created with mode
0777
modified by thelocal_umask
. The only supporting documentation I found about this is in the source code itself. As there is no official browser-readable source code available, I can only link to an unofficial source code mirror at https://github.com/dagwieers/vsftpd/blob/3.0.2/postlogin.c#L1179 where the "tunable umask" in the comment refers to thelocal_umask
configuration.