Secure FTP with SSL and Ubuntu 8.04 |
Server Training - FTP Server |
FTP communication is not secure, all communication is plain text and can be easily captured. Despite this serious weakness, few do anything to secure it. There are simple ways to correct this with VSFTPD. SSL/TLS With FTP anonymous_enable=YES You do not need to create the self-signed certificate as they are already created by the vsftpd server as you can see listed. Notice that ssl is enabled only for local logins, users who have accounts on the machine. The connection will still be on port 21. Once you have the server set up you will need a client that is ftps compatible.
Create Self-Signed Certificate You can create a self-signed certificate with this command which will create a certificate for 1 year and the pem file is then saved in the /etc/directory. Note that you will need to change the /etc/vsftpd.conf file to enter the path of this file. You will be asked several questions which will identify your organization. # openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/vsftpd.pem -out /etc/vsftpd.pem Generating a 1024 bit RSA private key ......++++++ ..++++++ writing new private key to '/etc/vsftpd.pem' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:US State or Province Name (full name) [Some-State]:MT Locality Name (eg, city) []:Trout Creek Organization Name (eg, company) [Internet Widgits Pty Ltd]:Example LTD Organizational Unit Name (eg, section) []: Common Name (eg, YOUR name) []:Fred Smith Email Address []: This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Edit /etc/vsftpd.conf and comment out the rsa certificate and private key files that are there by default and add these lines which show the path to your self-signed certificate. rsa_cert_file=/etc/vsftpd.pem Restart the ftp server. Using a FTP Client that is SSL/TLS Compatible When you connect you will be asked to accept the self-signed certificate, either which you made or the default for vsftp. Accept the certificate and you have encrypted FTP on port 21. If you have users connecting with FileZilla for Windows, which is reliable, you will need to make these changes so they can log in with SSL. Note the port is still 21 but the Servertype is now FTP over SSL.
Copyright CyberMontana Inc. and BeginLinux.com
All rights reserved. Cannot be reproduced without written permission. Box 1262 Trout Creek, MT 59874
|