After you have installed vsftpd using (sudo apt-get install vsftpd)
Find /etc/vsftpd.conf
Inside enable the following flags
# Enable this to allow users to write files to their web folder
write_enable=YES
# To restrict users to specific web folders and block access to parent folders
chroot_local_user=YES
# You may want to enable passive mode if you have a firewall
pasv_enable=YES
pasv_min_port=65000 (example, set your own)
pasv_max_port=65535 (example, set your own)
# Also remember to open up port 20 for FTP-DATA, 21, and 990 for TLS/SSL on your firewall
Next create your users and add them to the web group
useradd -s /usr/sbin/nologin {new_username}
sudo passwd {new_username} # you will be prompted to enter a password twice
sudo usermod -d /var/www/{web folder} {new_username}
usermod -a -G www-data {new_username}
Next do the following:
vi /etc/shells
# Add the following to the last line:
/usr/sbin/nologin
# Save that.
# Finally, restart your ftp server
service vsftpd restart
Now test your new web ftp user account and check if the directory is writable and also make sure the pages are viewable in a browser.
Anyway, thats how I did it and got it to work. Otherwise the published pages don’t display and a permission denied error appears because www-data cannot execute the files.