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.
Run the following command to install vsftpd:
apt-get install vsftpdOpen up the configuration file using your text editor of choice. This example uses Vim.
vim /etc/vsftpd.confvsftpd 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=NOTo allow local user login, uncomment the following line:
local_enable=YESTo enable uploading, uncomment the following line:
write_enable=YESSave the file and close your text editor. Then, start vsftpd as a daemon:
service vsftpd startAt this point, you can log in to your ftp Server from your local computer.
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=YESAs 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/userRemember to restart the vsftpd daemon after editing vsftpd.conf.
service vsftpd restart