How to Setup Secure FTP File Transfer Using SSL/TLS on ubuntu

STEP1.  For Installation Of Sercure FTP File on Ubntu use these Command-

sudo apt update

sudo apt-get install vsftpd

After Installing this restart and enable the services-

sudo systemctl stop vsftpd.service

sudo systemctl start vsftpd.service

sudo systemctl enable

Step 2: Create a Self-signed SSL/TLS certificate

After Installation of VSFTD is installed we have to run below command for generating SSL/TLS certificate for the server the generated server key is called

Vsftpdserverkey.pem and it will store in /etc/ssl/private and certificated file is called vsftpdcertificate.pem in the  /etc/ssl/certs


sudo openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/ssl/private/vsftpdserverkey.pem -out /etc/ssl/certs/vsftpdcertificate.pem -days 365

After running this command you will promoted to to give some answer about the certificate you generating.

Step 3: Configuring VSFTPD to use SSL/TLS

Now that you’ve generated the server private key and certificate files, go and configure VSFTPD to use the SSL/TLS certificate created above… To do that, run the commands below to open VSFTPD default configuration file.

sudo nano /etc/vsftpd.conf

sudo nano /etc/vsftpd.conf

Then make the highlighted changes below so that the server can could communicate over SSL/TLS

Now save changes.

Step 3: Restart VSFTPD Server

After adding the highlighted lines to the file, save it. Then run the commands below to restart VSFTPD server.

sudo systemctl restart vsftpd

Now grab your favorite FTP client (FileZilla) and setup a new site in your site manage and use FTP protocol with encryption with explicit FTP over TLS… Type your username and password and connect.

You should be prompted with a certificate… accept the certificate and continue. You may check the box at the bottom of the page to trusted the certificate so you don’t get prompted in the future.

You should now be transferring files securely via SSL/TLS

Page referred by

Leave a Reply

Your email address will not be published. Required fields are marked *