The steps in this tutorial are very similar to installing vsftpd on CentOS, with a few differences in syntax for installing the VSFTPd FTP daemon on Ubuntu 8.10.
To install VSFTPd you will use the 'apt-get' package management system that comes pre-installed with Ubuntu.
sudo apt-get update
sudo apt-get install vsftpd
You will see APT-GET display the following on your screen as it installs:
Note: You may be prompted to enter 'Y' before downloading packages from the Internet.
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: vsftpd 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0B/106kB of archives. After this operation, 430kB of additional disk space will be used. Selecting previously deselected package vsftpd. (Reading database ... 12201 files and directories currently installed.) Unpacking vsftpd (from .../vsftpd_2.0.7-0ubuntu1_amd64.deb) ... Setting up vsftpd (2.0.7-0ubuntu1) ... * Starting FTP server: vsftpd [ OK ]
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:
Should be changed to:
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.
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.
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.
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:
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.
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License