How to set up proftpd in Linux

This post is a guideline that I use to set up proftpd in a linux server.

 I create a user group for FTP users and assign a specific home folder where the WEB is located.

 I am using Debian Jessy.
First step install package:

apt-get install proftpd-basic

Edit config file and add the following lines

nano /etc/proftpd/proftpd.conf

    RequireValidShell off

DefaultRoot ~ ftpuser

<Limit LOGIN>
    DenyGroup !ftpuser

This way we will handle ftp users by adding them to a group ftpuser without a valid shell. They will also be jailed in the user’s own home directory.

Create new group, user and asign him the home directory. I am using /var/www/wordpress_one as home directory.

addgroup ftpuser
adduser ftpuserone -shell /bin/false -home /var/www/wordpress_one
adduser ftpuserone ftpuser

Change the group permissions of the folder so apache or other web servers can work with it. Apply also the default group for new files created. This is usefull when wordpress or other program create new files.

chown ftpuserone:www-data wordpress_one/
chmod g+s wordpress_one/

Restart the service and test the user

service proftpd restart

ftp -nv
220 ProFTPD 1.3.5b Server (Debian)
ftp> user ftpuserone
331 Password required for ftpuserone
230 User ftpuserone logged in
Remote system type is UNIX.

Now web files can be uploaded over ftp directly.