I have set up a web server and I'm using vsftpd to handle file uploads. The problem is, when i upload a new file both the owner and group for the uploaded file is set to the user that is logged into the FTP server. For example, when i log into FTP with my user account "kalle" and create a file, the ownership is set to "kalle:kalle". I want to use the current user as owner and www-data as group, which in my example means that the ownership would be "kalle:www-data".

Also, i want the permissions for the file to be 775, and i have set "local_umask=002" in "/etc/vsftpd.conf". As far as I understand, this would make the permissions 777-002=775, but it is instead set to 664.

The ownership and permissions of /var/www and all subfolders is "kalle:www-data" and 775.

Does anyone know how I can accomplish this?