Follow these steps to install the secure FTP server in Linux:
- Install vsftpd with the following command:
$ sudo apt-get update
$ sudo apt-get install vsftpd
- After installation, we can configure vsftpd by editing /etc/vsftpd.conf. Before editing the configuration file, don’t forget to create a backup of the file.
$ sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.bak
- First create the SSL certificate for the FTP server:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -
keyout /etc/ssl/private/vsftpd.pem -out
/etc/ssl/private/vsftpd.pem
- Next, configure Vsftpd. Add or edit the following lines in vsftpd.conf:
anonymous_enable=no
local_enable=yes
write_enable=yes
chroot_local_user=yes
Add the SSL certificate created in the previous step:
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_enable=yes
ssl_ciphers=high
force_local_data_ssl=yes
force_local_logins_ssl=yes
- Save and exit the configuration file.
- Restart the Vsftpd server:
$ sudo service vsftpd restart
- Now you can use any FTP client that supports the SFTP protocol to connect to your FTP server, for example, FileZilla.