We currently have a LAMP stack for shared webhosting, and are using ProFTP with that.
Currently the ProFTP config is fairly stock - users are chrooted to
~. Currently running as the default user/group. We only use system users - no virtual users.
We use SuPHP to run each PHP process as the appropriate user/group.
What I'd really like is to have ProFTP automatically set the
user:group of uploaded files to whomever is logged in. So if I login to FTP as "customer-a", I'd like any uploaded files be owned by "customer-a".
The main reason for this is, it seems, if I login as someone right now, they don't have permission to write to their home directory. Instead of loosening permissions, I'd like ProFTP to switch the user context appropriately.
1) This is a pain to do, I'd rather avoid having to append config for each user created. 2) ProFTP doesn't seem to support name-based virtual hosts.
I imagine something like this might work:
<Directory /home/customer-a/> UserOwner customer-a UserGroup customer-a </Directory>
But it would be nice to be able to do this in a more general fashion, similar to the
%u variable, documented here. But I don't think that will work with UserOwner.
- Using Ubuntu
- ProFTP 1.3.4a
- Apache 2.2
- Using SuPHP with PHP-CGI.