Install and configure vsftpd in Ubuntu

Transfering computer data can be done easily nowadays using usb thumb drive or external hard disk. However, user must copy directly from your computer every time they need certain data. The convenience way to share data in a network environment is using ftp server. Ftp server lets any user in the network who has permission to access the server to copy data directly from their computer.

It's a great idea to setup vsftpd even if you are using Ubuntu desktop for file sharing in your home network or in your work place. You can share data with other users including those using Windows operating system. Here is a guide on how to install vsftpd in Ubuntu desktop with step by step instructions and screenshot images.

This tutorial covers:

Install vsftpd in Ubuntu desktop

You can easily install vsftpd ftp server in Ubuntu desktop using Synaptics package manager. To open Synaptics package manager, click System, follow Administration's child menu and choose Synaptics package manager. Ubuntu will ask for your password to continue. The screenshot image below shows an example of Synaptics package manager pane when you successfully key in your password:

Synaptics package manager screenshot image.

Type 'vsftpd' in the Quick search text box. See example below:

Synaptics package manager - Quick search screenshot image.

You'll see some packages in the search results. Click on the vsftpd tick box and choose 'Mark for installation':

Synaptics package manager vsftpd search result screenshot image.

You can read a brief information about vsftpd in the description area like in the example below:

The Very Secure FTP Daemon
A lightweight, efficient FTP server written from the ground up with
security in mind.

vsftpd supports both anonymous and non-anonymous FTP, PAM authentication,
bandwidth limiting, and the Linux sendfile() facility.

Click Apply to install vsftpd ftp server in Ubuntu desktop.

Synaptics package manager - Apply vsftpd installation screenshot image.

It takes a few seconds to apply changes (install) vsftpd in Ubuntu desktop. Click Close when vsftpd installation is finished. Quit Synaptics package manager when you are done.

Configure vsftpd in Ubuntu

Open command line 'Terminal' from the Accessories sub-menu in Applications. Open vsftpd configuration file with text editor.

[email protected]:~$ sudo vim /etc/vsftpd.conf
[sudo] password for kucing:

You can set ftp configuration rules by reading the comment description. Here are example vsftpd configurations to allow anonymous and ubuntu local users:

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
# Uncomment this to allow local users to log in.

If you want to block anonymous login into the vsftpd ftp server, set 'anonymous_enable=NO'.

If you want to allow users to upload data to the vsftpd or create a directory, enable(uncomment) 'write_enable=YES'.

# Uncomment this to enable any form of FTP write command.

Set umask permission to 022:

# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)

This is a continuity rules if you want to enable users to upload data to the ftp server and create directory, enable 'anon_upload_enable=YES' and 'anon_mkdir_write_enable=YES':

# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.

Change data connection time out too 600. The default 120 is too short which will cause a big data transfer failed.

# You may change the default value for timing out a data connection.

Enable 'chroot_local_user=YES' to restrict local users to their home directories. This is recommended for security.

# You may restrict local users to their home directories. See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.

That's it. You can leave other rules which is allow by default.

Start and restart vsftpd in Ubuntu

Now we can start vsftpd service to begin using ftp server. Here is the command to start vsftpd in Ubuntu:

[email protected]:~$ sudo /etc/init.d/vsftpd start
[sudo] password for kucing:
* Starting FTP server: vsftpd
/usr/sbin/vsftpd already running.

Here is the command to restart vsftpd in Ubuntu if you edit vsftpd configuration file again:

[email protected]:~$ sudo /etc/init.d/vsftpd restart
* Stopping FTP server: vsftpd [ OK ]
* Starting FTP server: vsftpd [ OK ]
[email protected]:~$

That's all. Enjoy!

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.