I want to control my ProFTPd authentication by a MySQL database. Users will be able to change the username and password of their FTP account(s) in a PHP web application. This provokes a following problem: The users set in the database usertable do not match the system users. So I am not able to change the directory permissions in my filesystem and ProFTPd logs the error:
username chdir("/var/www/vhosts/sites/username"): Permission denied
But how could I give these FTP users access to these folders? If I set up a user called www-data
it works fine but the usernames will not be defined in /etc/passwd
.
The second thing I want to manage is the restriction of this only directory, in this case /var/www/vhosts/sites/username
. The user mustn't have access to other directories if they are not in the home directory above.
How do I fix this?