[iyunv@red-hat-5 ~]#openssl req -x509 -nodes -days 365 -newkey rsa:1024 \-keyout /etc/vsftpd/vsftpd.pem \-out /etc/vsftpd/vsftpd.pem ==è生成vsftpd.pem 证书
Generating a 1024 bit 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) [GB]:cn
State or Province Name (full name) [Berkshire]: shanghai
Locality Name (eg, city) [Newbury]:shanghai
Organization Name (eg, company) [My Company Ltd]:ys ==è根据提示填写一些信息
Organizational Unit Name (eg, section) []:ys
Common Name (eg, your name or your server's hostname) []:viong
Email Address []:viong@viong.com
[iyunv@localhost ~]# ll /etc/vsftpd/ ==è查看是否生成vsftpd.pem文件
-rw-r--r-- 1 root root 197 12-25 19:57 chroot_list
-rw--------1 root root 125 2007-12-13 ftpusers
-rw------- 1 root root 361 2007-12-13 user_list
-rw------- 1 root root 4396 12-25 19:19 vsftpd.conf
-rwxr--r-- 1 root root 338 2007-12-13 vsftpd_conf_migrate.sh -rw-r--r-- 1 root root 2168 01-08 01:53 vsftpd.pem ==è生成vsftpd.pem成功
[iyunv@red-hat-5 ~]# vi /etc/vsftpd/vsftpd.conf ==è编辑主配置文件,添加以下参数
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
rsa_cert_file=/etc/vsftpd/vsftpd.pem