At this point the vsftpd daemon has been started and FTP services are working. We need to make a few configuration changes before the server is ready for production use. To stop the vsftpd daemon type the following command:

sudo service vsftpd stop

You should see the following message:

* Stopping FTP server: vsftpd [ OK ]

To modify the configuration file we will need to use the 'vi' editor. Type the following command to open /etc/vsftpd.conf in the editor:

sudo vi /etc/vsftpd.conf

You will be presented with a screen that looks like the following:

# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
#
# Run standalone? vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=YES
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Scroll down in the window until you see the line that reads anonymous_enable=YES. We need to change this option to NO so anonymous connections will be no longer accepted.

To put the vi editor into write mode press the i key on your keyboard. Scroll back down (if necessary) to the line above and add a # in front of the line. Once you have made the change press the ESC (escape) key on your keyboard to leave the editing mode.

So this line:

anonymous_enable=YES

Should be changed to:

anonymous_enable=NO

Now we need to set an option that allows local users to login to the FTP server. Scroll down to the line that reads #local_enable=YES. With your cursor at the beginning of the line press the x key on your keyboard to remove the # symbol at the beginning of the line.

This line:

#local_enable=YES

Should read:

local_enable=YES

We also need to allow users to write changes to the server. Scroll down to the next line that reads #write_enable=YES. Again with your cursor at the beginning of the line press the x key on your keyboard to remove the # symbol at the beginning of the line.

This line:

#write_enable=YES

Should read:

write_enable=YES

Next we will need to restrict users to their home directory when they connect to the server. This option stops users from trying to look around your server's file system and cause harm. Scroll down to the line that reads #chroot_local_user=YES. Once again move your cursor to the beginning of the line and press the x key on your keyboard to remove the # character.

This line:

#chroot_local_user=YES

Should read:

chroot_local_user=YES

Now we need to save the file. You can do this by pressing the colon key followed by w and then q and pressing enter. You should see the following text at the bottom of the window:

:wq

You will be returned back to the bash prompt and your file will be saved.

Now you are ready to start your FTP server. Type the following command to start the server:

sudo service vsftpd start

If you see an OK response then you are ready to go!

Using vsftpd is not the only way of securely transferring files. From one Linux server to another, you can use SCP (secure copy), or Secure FTP - both utilities that are part of the SSH package.