Install FTP Server with vsftpd on Linux Mint 14

FTP stands for “file transfer protocol”, and it allows you to transfer files to a remote computer. FTP has been around forever, and it has a number of pros and cons. Since FTP is so old, it is supported on virtually every operating system, and most operating systems include an FTP client of some kind. Linux Mint 14 can act as an FTP server with a reasonable degree of security. In this post, we’ll show you how to set up Linux Mint 14 as an FTP server.

The most common FTP server software for Linux Mint is the vsftpd package, which stands for “very secure FTP daemon.” It’s the default FTP package for Linux Mint 14, and most other Linux distributions as well. As an added bonus, vsftpd is pretty secure out of the box – to make it insecure, you have to go out of your way to mess up the configuration file.

As an added bonus, vsftpd is simple to install and configure on a Linux Mint 14 machine. To install the vsftpd package, make your way to a command prompt and type this command:

sudo apt-get install vsftpd

Enter your password to authenticate and apt will download and install vsftpd for you.

Follow the default prompts, and the vsftpd server will be installed on your computer. Generally, the default configuration for vsftpd is pretty secure, and good enough for casual use. Anonymous users are allowed, but no one can write files to the server (or, in FTP terminology, no one can upload files to the server). However, this configuration isn’t very good if you want people to be able to write files to the server, so we’ll show you how to securely set that up by changing vsftpd’s settings.

If you want to change any settings, the configuration file for vsftpd is /etc/vsftpd.conf. Like any other configuration file, you can edit it with vi:

sudo vi /etc/vsftpd.conf

The vsftpd.conf file contains a large number of “directives” that govern how the server behaves and operates. If you want to change its configuration, you’ll need to alter the directives.

If you want people with local user accounts on the FTP server to be able to connect via FTP (you usually do), you will need to change this directive:

#local_enable=YES

To this:

local_enable=YES

If you do not change this directive, only anonymous users will be able to log into your FTP server, which is bad. (More on that below.)

If you want users to be able to write files to your FTP server, change this directive:

#write_enable=YES

To this:

write_enable=YES

With the write_enable directive set to YES, users will be able to upload files to your FTP server. Note, however, that they will only be able to do so if they have proper permissions to the directories in question. They’ll be able to upload files to their home directories, but not, for instance /var or /usr.

Anonymous access is controlled with this directive:

anonymous_enable=NO

Under no circumstances should you allow anonymous access to your FTP server, especially if it is accessible from the Internet! There are certain circumstances when you might find it useful, but you should only enable it if you know exactly what you are doing. Generally, it is almost always best to keep anonymous_enable set to NO. Especially if you allow users to write files to your FTP server, then it is very important to have anonymous_enable set to NO.

If you make any changes to the file, switch vi to command mode, save the changes, and then exit vi. Then restart the vsftpd server so it reads its new directives:

sudo service vsftpd restart

Your Linux Mint machine should now have a functional FTP server.

-JM

ADDITIONAL READING:

The Linux Command Line Beginner’s Guide.

The Ubuntu Beginner’s Guide

The Ubuntu Desktop Beginner’s Guide.

This entry was posted in Linux Mint 14. Bookmark the permalink.

One Response to Install FTP Server with vsftpd on Linux Mint 14

  1. Glen says:

    Although the commands and editing give me no error on the server, and I’m told I have successfully logged in, the server doesn’t actually work. Any idea what’s going on? An ftp session from my windows cmd.exe window shows the following info.

    User (192.168.56.144:(none)): glen
    331 Please specify the password.
    Password:
    230 Login successful.
    ftp> ls
    200 PORT command successful. Consider using PASV.
    425 Failed to establish connection.
    ftp>