How to set up an IPv6 enabled FTP server: vsftpd

Many people are searching for configuration examples on how to set up an IPv6 enabled FTP server like vsftpd. Here you will find examples of a number of popular FTP servers. This article covers vstftpd for Linux.

vsftpd

 
Let’s have a look at vsftpd. vsftpd is a stable GPL licensed FTP server for UNIX systems, including Linux. It is secure and very fast. The configuration example is based on an Ubuntu installation an assumes you have an active IPv6 network stack:

Install the vsftpd package:

 

apt-get update

Let’s install vsftpd and any other required package:

apt-get -y install vsftpd

Configure vsftpd:

 
Use your favorite editor to edit the configuration file for vsftpd:

vim /etc/vsftpd.conf

First of all, disallow anonymous, unidentified users to access files via FTP; change the anonymous_enable setting to NO:

anonymous_enable=NO

Allow local uses to login by changing the local_enable setting to YES:

local_enable=YES

If you want a local user to have write permissions, then change the write_enable setting to YES:

write_enable=YES

You probably want local users to be ‘chroot jailed’ so they will only have access to their own environment and cannot see anything else on the system; change thechroot_local_user setting to YES:

chroot_local_user=YES

Make the server stop listening on IPv4:

listen=NO

Now make the server listen on an IPv6 socket:

 listen_ipv6=YES

You may want to go over the other options which I will not cover here as they fall outside the scope of this example. Then exit and save the file by typing:

wq

Restart the vsftpd service:

service vsftpd restart

And done.

Check to see if it is listening on an IPv6 socket:

netstat -an6|grep 21

Which should produce an output similar to:

tcp6       0      0 :::21                   :::*                    LISTEN