vsftpd (Very Secure FTP Daemon) is a secure and fast FTP server for Unix-like systems. In this guide, we will walk through the steps to install vsftpd on Debian 11 and secure it with TLS.
Step 1: Update Your System
Start by ensuring your system is up to date:
sudo apt update && sudo apt upgrade -y
Step 2: Install vsftpd
Install vsftpd using the following command:
sudo apt install -y vsftpd
Step 3: Configure vsftpd
Edit the vsftpd configuration file:
sudo nano /etc/vsftpd.conf
Make the following changes to the configuration file:
- Enable anonymous access if needed:
anonymous_enable=NO
- Allow local users to log in:
local_enable=YES
- Enable writing for local users:
write_enable=YES
- Enable chroot for local users:
chroot_local_user=YES
- Set the passive mode range:
pasv_min_port=10000
pasv_max_port=10100
- Enable TLS:
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_tlsv1_1=YES
ssl_tlsv1_2=YES
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
Step 4: Create SSL Certificate
Generate a self-signed SSL certificate for vsftpd:
sudo mkdir /etc/ssl/private
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem
Fill in the details as prompted, or you can press Enter to leave the default values.
Step 5: Restart vsftpd
Restart the vsftpd service to apply the changes:
sudo systemctl restart vsftpd
Step 6: Configure Firewall
If you have a firewall enabled, allow FTP and the passive port range:
sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
sudo ufw allow 10000:10100/tcp
sudo ufw reload
Step 7: Accessing vsftpd
You can now connect to your FTP server using any FTP client. Ensure to select the option to use TLS for secure connections.
Conclusion
You have successfully installed vsftpd and secured it with TLS on Debian 11. This setup provides a secure FTP solution for your file transfers.
If you're looking for a reliable hosting solution for your FTP server, consider using Windows VPS UK. With Windows VPS, you can efficiently host your applications and ensure high performance. Whether you need VPS UK Windows or Windows Virtual Private Servers, you'll find a solution that fits your requirements.
For larger deployments or enterprise needs, explore Windows Virtual Dedicated Server Hosting or Virtual Private Server Hosting Windows. Whether you're located in the UK, Italy, or elsewhere, Windows VPS Italy and UK VPS Windows offer reliable hosting options. Visit Windows VPS Hosting UK to discover the best hosting solutions for your FTP needs.