Ubuntu – How Do I Configure ProFTP for Website Update

ftpproftpdUbuntuubuntu-9.10

I am running Ubuntu Server 9.10 with ProFTPD, and I also have Webmin.

I have DNS setup for 3 domains, mail setup for 3 domains, as well as Apache2 setup for those domains. They work great.

Now I want to give FTP access for an incoming user, but point them to /var/www/[domain] and have them come in as something like user "ftpuser" but want this to translate to user "www-data" so that web permissions will be correct.

What is the technique to do this?

Best Answer

Groups and SGID. user1 would have group membership in www-data and you would set everything group writable under [domain]. Set user1's home directory to /var/www/[domain]. You would also want to set the SGID on [domain] and all directories under it, which would cause permissions to be inherited. (g+s)

Be aware, user1 would have access to all Web content. You could use a different group to limit the scope of the access.

SSH (SFTP/scp) is recommended for user authentication as opposed to FTP, as the authentication credentials will be transmitted in plaintext with FTP.