An easy (read: automated) way to set up FTP jails for each user in their respective folder so they can access, upload, and edit site files – with multiple instances on the same server.
A tutorial about FTP configuration with multiple users and directory restriction.
PROFTPD INSTALLATION
Update your packages repository list and install proftpd server
apt-get update && apt-get install proftpdThen edit proftpd configuration file :
nano /etc/proftpd/proftpd.confAnd just remove the # at the beginning of the line
DefaultRoot ~Restart proftpd server to apply the configuration
service proftpd restartADD A NEW FTP USER
To add a user, it requires to define his home folder, which is the website folder you want to use, and to include our ftp user in group www-data.
Just replace the folder and user in the following command :
adduser --home /var/www/yourdomain.ltd/ --ingroup www-data your-ftp-userThe last step is to edit permissions on your website folder
chmod -R g+rw /var/www/domainnameYou can now login with your favorite ftp client, and your new user will only be able to access to his home folder.

Leave a Reply