I have been trying to get this working for way too long. I have a setup where I need to provide email from a server, but do not want to create system users. I have created a user database in MySQL and used PAM (portable authentication modules) to authenticate users. I had to do a bit of research, but got that to work. I can now create an FTP user (through a web interface), and it is added to MySQL. PAM then reads this database to log a user in.
The user can then use an FTP client and access the base directory as expected. Browsing works, downloading works but delete and upload fail with 550 errors. This makes me think of permission errors.
I set up a Linux system user (virtualftp) and configured this user so that any virtual FTP user would be mapped to this system user.
My folder structure is as follows...
/var/www/example.com <<home directory
-public_html
-documents
-mail
The obvious conflict is that I need FTP to be able to access the home directory and every folder under it. The kicker is public_html because it needs to be under the group ww-data. My solution was to make virtualftp a member of the ww-data group. I believe this worked because it does allow me to browse all folders and download. The write issue is the only problem.
the /var/www is owned by root and is 755
all subfolders are owned by virtualftp (ww-data member)
Open to any ideas or suggestions.
Mack.