I have client who is the owner of a printer shop. I have configured for him an FTP Server where clients can drop him big files they want to print.
I have created several FTP users. He has some premium clients and some regular clients. Regular clients are told to use the FTP user clients. The owner has a folder called clients with the next permisions.
printshopowner# ls -la
drwx-----x 9 printshopowner printshopowner 4096 Aug 17 08:07 .
drwx-wx-wx 9 printshopowner clients 4096 Jan 19 10:24 clients
drwxrwx--- 2 premiumuser printshopowner 4096 Jan 19 08:13 premiumuser
It is working fine. A Client can upload files without seeing other clients' files. Problem is when a client uploads a folder. The FTP user printshopowner can not delete these folders.
[printshopowner/clients]# ls -la
drwx-wx-wx 9 printshopowner clientes 4096 Jan 19 10:24 .
drwx-----x 9 printshopowner printshopowner 4096 Aug 17 08:07 ..
drwxr-xr-x 3 clients clients 4096 Dec 3 11:57 folderA
Any idea how should I configured the FTP dropbox to achieve the desired functionality?
Best Answer
You can try setting local_umask in vsftpd.conf
local_umask = 0002
Also consider looking into file_open_mode. This controls the permissions with which uploaded files are created with umasks being applied on top of this value.