Setting Up vsftpd + TLS On Debian Squeeze
Setting Up vsftpd + TLS On Debian SqueezeVersion 1.0 FTP is a very insecure protocol because all passwords and all data are transferred in clear text. By using TLS, the whole communication can be encrypted, thus making FTP much more secure. This article explains how to set up vsftpd with TLS on a Debian Squeeze server. I do not issue any guarantee that this will work for you!
1 Preliminary NoteIn this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100. These settings might differ for you, so you have to replace them where appropriate.
2 Installing vsftpd And OpenSSLOpenSSL is needed by TLS; to install vsftpd and OpenSSL, we simply run: apt-get install vsftpd openssl
3 Creating The SSL Certificate For TLSIn order to use TLS, we must create an SSL certificate. I create it in /etc/ssl/private - if the directory doesn't exist, create it now:: mkdir -p /etc/ssl/private Afterwards, we can generate the SSL certificate as follows: openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem Country Name (2 letter code) [AU]: <-- Enter your Country Name (e.g., "DE").
4 Enabling TLS In vsftpdIn order to enable TLS in vsftpd, open /etc/vsftpd.conf... vi /etc/vsftpd.conf ... and add or change the following options:
If you use force_local_logins_ssl=YES and force_local_data_ssl=YES, then only TLS connections are allowed (this locks out any users with old FTP clients that don't have TLS support); by using force_local_logins_ssl=NO and force_local_data_ssl=NO both TLS and non-TLS connections are allowed, depending on what the FTP client supports. Apart from the TLS options, make sure you also have the following settings in your vsftpd.conf to enable non-anonymous logins:
Restart vsftpd afterwards: /etc/init.d/vsftpd restart That's it. You can now try to connect using your FTP client; however, you should configure your FTP client to use TLS (this is a must if you use force_local_logins_ssl=YES and force_local_data_ssl=YES) - see the next chapter how to do this with FileZilla.
5 Configuring FileZilla For TLSIn order to use FTP with TLS, you need an FTP client that supports TLS, such as FileZilla. In FileZilla, open the Server Manager:
Select the server that uses vsftpd with TLS; in the Server Type drop-down menu, select FTPES instead of normal FTP: Now you can connect to the server. If you do this for the first time, you must accept the server's new SSL certificate: If everything goes well, you should now be logged in on the server:
6 Links
|







Recent comments
18 hours 57 min ago
23 hours 56 min ago
1 day 1 hour ago
1 day 2 hours ago
1 day 3 hours ago
1 day 8 hours ago
1 day 9 hours ago
1 day 11 hours ago
2 days 34 min ago
2 days 2 hours ago