Install vsftpd

Step 1: Installation

Run the following command to install vsftpd:

apt-get install vsftpd

Step 2: Configuration

Open up the configuration file using your text editor of choice. This example uses vim.

nano /etc/vsftpd.conf

Copy these

#listen=NO
anonymous_enable=YES
local_enable=YES
write_enable=YES
#local_umask=022
local_umask=002
#dirmessage_enable=YES
#chroot_local_user=YES
#pam_service_name=vsftpd
pam_service_name=ftp

Add to end:

#Google Compute config
pasv_min_port=5000
pasv_max_port=6000

#Wordpress FTPS config
#allow_anon_sll=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
listen_port=21

Save the file and close your text editor. Then, start vsftpd as a daemon:

service vsftpd start

At this point, you can log in your ftp server from your local computer.

Extras

If you want to prevent all local users from leaving their home directory, you need to uncomment this line from /etc/vsftpd.conf:

chroot_local_user=YES

As of vsftpd 2.3.5, the chroot directory must not be writable. You can change the permissions of this folder with the following command:

chmod a-w /home/user

Remember to restart the vsftpd daemon after editing vsftpd.conf.

service vsftpd restart