Setup vsFTPd on Debian/Ubuntu

Updated on November 21, 2023
Setup vsFTPd on Debian/Ubuntu header image

Introduction

vsftpd stands for Very Secure FTP Daemon. It's a lightweight FTP server. This short tutorial explains how to install vsftpd on Debian or Ubuntu. The commands in this tutorial require root privileges.

Step 1: Installation

Run the following command to install vsftpd:

apt-get install vsftpd

Step 2: Configuration

Open up the configuration file using your text editor of choice. This example uses vim.

vim /etc/vsftpd.conf

vsftpd allows anonymous users to access the server by default. This feature could be considered a security vulnerability. We will disable anonymous login by changing the following line:

anonymous_enable=NO

To allow local user login, uncomment the following line:

local_enable=YES

To enable uploading, uncomment the following line:

write_enable=YES

Save the file and close your text editor. Then, start vsftpd as a daemon:

service vsftpd start

At this point, you can log in your ftp server from your local computer.

Extras

If you want to prevent all local users from leaving their home directory, you need to uncomment this line from /etc/vsftpd.conf:

chroot_local_user=YES

As of vsftpd 2.3.5, the chroot directory must not be writable. You can change the permissions of this folder with the following command:

chmod a-w /home/user

Remember to restart the vsftpd daemon after editing vsftpd.conf.

service vsftpd restart