cd /etc/ssl/private
openssl req -x509 -nodes -newkey rsa:2048 -keyout vsftpd.pem -out vsftpd.pem -days 365Generating a RSA private key
.....................+++++
...................................................................................................................................................+++++
writing new private key to '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]: country code
State or Province Name (full name)[Some-State]: state
Locality Name (eg, city)[]: city
Organization Name (eg, company)[Internet Widgits Pty Ltd]: company
Organizational Unit Name (eg, section)[]: department
Common Name (e.g. server FQDN or YOUR name)[]: server's FQDN
Email Address []: admin's e-mail
cd /etc/ssl/private
openssl req -x509 -nodes -newkey rsa:2048 -keyout vsftpd.pem -out vsftpd.pem -days 365Generating a RSA private key
..............+++++
.+++++
writing new private key to '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]: country code
State or Province Name (full name)[Some-State]: state
Locality Name (eg, city)[]: city
Organization Name (eg, company)[Internet Widgits Pty Ltd]: company
Organizational Unit Name (eg, section)[]: department
Common Name (e.g. server FQDN or YOUR name)[]: server's FQDN
Email Address []: admin's e-mail
Red Hat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
cd /etc/ssl/certs
openssl req -x509 -nodes -newkey rsa:2048 -keyout vsftpd.pem -out vsftpd.pem -days 365.+..+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.....+.....+.......+...+..+.+...+.....+.......+..+.+...........+...+...+...+.+.........+..+.......+..+.+..+.+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.....+...........+......+.+..+......+.+...+..+.+........+.+...+......+..+..........+..+.+.....................+......+.....+....+......+..+.+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
........+.........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+...+......+.........+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...+....+...........+..........+......+.....+...+...+.......+...+...+..+...+....+..+.+..+...+.......+............+.........+..+...+......+....+......+.....+.+..............+...+...+...+....+..+....+.........+...............+........+..........+..+......+.......+.........+......+...............+..+..........+.................+....+...........+.............+.....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
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)[XX]: country code
State or Province Name (full name)[]: state
Locality Name (eg, city)[Default City]: city
Organization Name (eg, company)[Default Company Ltd]: company
Organizational Unit Name (eg, section)[]: department
Common Name (eg, your name or your server's hostname) []: server's FQDN
Email Address []: admin's e-mail
Configure SSL in Vsftpd
SLES
1
2
3
4
5
6
7
8
sudo vim /etc/vsftpd.conf
ssl_enable=YES
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_ciphers=HIGH
force_local_data_ssl=YES
force_local_logins_ssl=YES
#dsa_cert_file=
Debian
1
2
3
4
5
6
7
8
sudo vim /etc/vsftpd.conf
ssl_enable=YES
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_ciphers=HIGH
force_local_data_ssl=YES
force_local_logins_ssl=YES
#dsa_cert_file=
Red Hat
1
2
3
4
5
6
7
8
sudo vim /etc/vsftpd/vsftpd.conf
ssl_enable=YES
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_ciphers=HIGH
force_local_data_ssl=YES
force_local_logins_ssl=YES
#dsa_cert_file=
Restart Vsftpd.
SLES
1
sudo systemctl restart vsftpd
Debian
1
sudo systemctl restart vsftpd
Red Hat
1
sudo systemctl restart vsftpd
Configure lftp client
1
2
3
4
5
6
7
8
vim ~/.lftprc
set ftp:ssl-protect-fxp yes
set ftp:ssl-allow yes
set ftp:ssl-auth TLS
set ftp:ssl-force yes
set ssl:verify-certificate no
set ftp:ssl-protect-data yes
set ftp:ssl-protect-list yes