In this tutorial, we will show you how to easily create an FTP server with virtual users using the vsFTP daemon on Debian 8.
First things first. Update your Debian VPS:
If you don’t have Apache2 webserver or if you are using NGINX, you will have to install apache2-utils
which is needed to generate passwords for the users.
Install the vsftpd service:
Edit the vsftpd configuration file and uncomment the bellow lines. Use vim
or nano
. The lines that are not present in the conf file, put them at the bottom.
Next, we should modify our /etc/pam.d/vsftpd
file to check the users/passwords file that we are about to create.
First, create a backup of the file and then edit the existing one:
Remove everything from the file and add these lines instead:
Create the main user that will be used by the virtual users to authenticate:
Once that is done we can create our users/passwords file.
Note: The passwords used by this method can be up to 8 characters long. If you wish vsftpd to read stronger passwords you might want to search for a different pam module.
Add another user and append it to the ftpd.passwd file. The -c
flag is omitted here.
Next, add the directories for the users since vsftpd will not create them automatically.
Finally, start the vsftp daemon and set it to automatically start on system boot.
Check the status to make sure the service is started:
Test your setup
Use FileZilla or WinSCP to login to your VPS using the users and passwords that you created previously.
Create a test directory and a test file from the clients.
On the server check that the files are successfully created with:
Of course, you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to set up your FTP server. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.