Firstly, I will quickly say....
FTPS or SFTP
People intend to mix FTPS and SFTP together, but both are actually completely differend.
FTPS is a normal FTP server but using SSL encrytion.
SFTP is a ftp kind of session over SSH (so everything is encrypted just like in SSH).
Notes
Users Guide: http://proftpd.org/localsite/Userguide/linked/userguide.html
Steps
*** Ensure mod_tls module is available within your proftpd installation.
*** Ensure you are a root user
1. Open proftpd.conf and add an include to a config file we are going to create (tls.conf). Add the following line below...
2. Now use vi to create the config file in the specified location...
Code Snippet
- vi /etc/proftpd/tls.conf
End of Code Snippet
3. Enter the following information into the file (How to use vi)
Code Snippet
- <IfModule mod_tls.c>
- TLSEngine on
- TLSLog /var/log/proftpd/tls.log
- TLSProtocol SSLv23
- TLSRSACertificateFile /etc/proftpd/ssl/proftpd.cert.pem
- TLSRSACertificateKeyFile /etc/proftpd/ssl/proftpd.key.pem
- #
- # Avoid CA cert and allow client renegotiation (to overcome 1.3.2c bug 3324)
- #TLSOptions NoCertRequest AllowClientRenegotiation
- #
- # Authenticate clients that want to use FTP over TLS?
- #
- TLSVerifyClient off
- #
- # Are clients required to use FTP over TLS when talking to this server?
- #
- TLSRequired on
- #
- # Allow SSL/TLS renegotiations when the client requests them, but
- # do not force the renegotations. Some clients do not support
- # SSL/TLS renegotiations; when mod_tls forces a renegotiation, these
- # clients will close the data connection, or there will be a timeout
- # on an idle data connection.
- #
- TLSRenegotiate required off
- </IfModule>
End of Code Snippet
4. Generate certificate using OpenSSL
Code Snippet
- openssl req -new -x509 -days 365 -nodes -out /etc/proftpd/ssl/proftpd.cert.pem -keyout /etc/proftpd/ssl/proftpd.key.pem
End of Code Snippet
5. Save and close the file.
6. Now restart proftpd for the changes to take effect.
Code Snippet
- /etc/init.d/proftpd restart
End of Code Snippet
7. Test FTPS connectivity with the server. See below...
Note: if there are any issues with the connection process, check the log file within the tls.conf file we created: /var/log/proftpd/tls.log
Testing FTPS with lftp
1. Execute following command
Code Snippet
- lftp -u USERNAMEHERE -e 'set ftp:ssl-force true,ftp:ssl-protect-data true' SERVERNAMEHERE
End of Code Snippet
2. Enter password for user.
3. Perform a simple command...
Code Snippet
- ls -l
End of Code Snippet
No comments:
Post a Comment