VSFTPD anonymous upload mask

Hi, all,

I am trying to make an FTP server using vsftpd with anonymous upload enable.

I want a local user to be an owner of anonymous uploaded files and set their permissions to 644. So I added the following to my vsftpd.conf:

file_open_mode=0666
anon_umask=022
chown_uploads=YES
chown_username=vma

But when I tried to upload file under anonymous, its permissions were set to 600:

-rw------- vma ftp 1.txt

The result is the same with all local users in chown_username parameter. But if I set chown_uploads=NO it’s ok!

-rw-r–r-- ftp ftp 4.txt

So, the question is: why aren’t permissions being set properly with local user as owner?

There is another umask setting: local_umask. See if that has any effect. It may be that you need to use the local_umask setting if you are going to chown.

local_umask is also set to 022.

I found out that directories are created with proper permission: rwxr-xr-x.
Why doesn’t this work with files?

chown_upload_mode
The file mode to force for chown()ed anonymous uploads. (Added in v2.0.6).

          Default: 0600

man vsftpd.conf :wink:

It works, thanks!!!

man vsftpd.conf is really helpful:smile: