Install FTP server (vsftpd)

# install
apt-get -y install vsftpd
 
# configure (non anonymous)
cp /etc/vsftpd.conf /etc/vsftpd.conf.org
sed -i 's|anonymous_enable=YES|anonymous_enable=NO|g' /etc/vsftpd.conf
sed -i 's|#local_enable=YES|local_enable=YES|g' /etc/vsftpd.conf
sed -i 's|#write_enable=YES|write_enable=YES|g' /etc/vsftpd.conf
sed -i 's|#chroot_local_user=YES|chroot_local_user=YES|g' /etc/vsftpd.conf
 
# OPTIONAL: configure anonymous (DANGEROUS!!!)
sed -i 's|anonymous_enable=NO|anonymous_enable=YES|g' /etc/vsftpd.conf
sed -i 's|#anon_upload_enable=YES|anon_upload_enable=YES|g' /etc/vsftpd.conf
sed -i 's|#anon_mkdir_write_enable=YES|anon_mkdir_write_enable=YES|g' /etc/vsftpd.conf
 
# create new user
USER=YOUR_FTP_USER
useradd -m ${USER}
passwd ${USER}
rm /home/${USER}/.*
 
# restart ftp server
/etc/init.d/vsftpd restart
 
 
# Optional: FTPS (FTP over SSL)
# diff /etc/vsftpd.conf.org /etc/vsftpd.conf
23c23
< anonymous_enable=YES
---
> anonymous_enable=no
26c26
< #local_enable=YES
---
> local_enable=YES
29c29
< #write_enable=YES
---
> write_enable=YES
147a148,163
> 
> 
> ssl_enable=YES
> allow_anon_ssl=NO
> force_local_data_ssl=YES
> force_local_logins_ssl=YES
> 
> ssl_tlsv1=YES
> ssl_sslv2=NO
> ssl_sslv3=NO
> 
> require_ssl_reuse=NO
> ssl_ciphers=HIGH
> 
> rsa_cert_file=/etc/ssl/private/vsftpd.pem
> rsa_private_key_file=/etc/ssl/private/vsftpd.pem
 
# LINKS
https://www.digitalocean.com/community/tutorials/how-to-configure-vsftpd-to-use-ssl-tls-on-an-ubuntu-vps
http://wiki.ubuntuusers.de/vsftpd