4、修改配置
1)备份下配置
cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf.bak
2)cat /etc/proftpd/proftpd.conf
Include /etc/proftpd/modules.conf
RootLogin off
IdentLookups off
UseReverseDNS off
ServerIdent off
AllowStoreRestart on
AllowRetrieveRestart on
ServerName "Debian"
ServerType standalone
MultilineRFC2228 on
DefaultServer off
ListOptions "-l"
DenyFilter \*.*/
DefaultRoot /opt/ftpdata
RequireValidShell off
DefaultAddress 10.1.10.117
SocketBindTight on
Port 21
MaxInstances 30
User proftpd
Group nogroup
Umask 022 022
AllowOverwrite on
TransferLog /var/log/proftpd/xferlog
SystemLog /var/log/proftpd/proftpd.log
5、配置说明
Include /etc/proftpd/modules.conf
RootLogin off #禁止root登录
IdentLookups off #禁止DNS反查
UseReverseDNS off #禁止DNS反查
ServerIdent off #隐藏版本号
AllowStoreRestart on #支持上传续传
AllowRetrieveRestart on #支持下载续传
ServerName "Debian" #服务器名称
ServerType standalone #使用standalone方式启动服务
MultilineRFC2228 on #FTP安全扩展
DefaultServer off #关闭默认主机
ListOptions "-l" #
DenyFilter \*.*/ #
DefaultRoot /opt/ftpdata #锁定在/opt/ftpdata目录中,可以进下一级目录
RequireValidShell off #不指定ftp用户的shell
DefaultAddress 10.1.10.117 #监听地址
SocketBindTight on
Port 21 #监听端口
MaxInstances 30 #最大线程数
User proftpd #以proftpd用户运行
Group nogroup #以nogroup组运行
Umask 022 022 #用户文件属性
AllowOverwrite on #能重写、覆盖
TransferLog /var/log/proftpd/xferlog #日志
SystemLog /var/log/proftpd/proftpd.log #日志
2、创建一个证书(时间365天)并填写相关一些信息
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -out /etc/ssl/certs/proftpd.pem -keyout /etc/ssl/certs/proftpd.pem
Generating a 2048 bit RSA private key
............................................................................................................................+++
...................+++
writing new private key to '/etc/ssl/certs/proftpd.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]:CN
State or Province Name (full name) [Some-State]:shanghai
Locality Name (eg, city) []:shangahi
Organization Name (eg, company) [Internet Widgits Pty Ltd]:aaa
Organizational Unit Name (eg, section) []:aaa
Common Name (e.g. server FQDN or YOUR name) []:aaa
Email Address []:
3、修改权限
chmod 0400 /etc/ssl/certs/proftpd.pem
4、修改/etc/proftpd/proftpd.conf支持tls 添加在最后
TLSEngine on
TLSRequired on
TLSProtocol TLSv1 SSLv23
TLSLog /var/log/proftpd/tls.log
TLSRSACertificateFile /etc/ssl/certs/proftpd.pem
TLSRSACertificateKeyFile /etc/ssl/certs/proftpd.pem
5、重启服务
/etc/init.d/proftpd restart
[ ok ] Stopping ftp server: proftpd.
[ ok ] Starting ftp server: proftpd.
7、查看日志
Aug 05 16:11:30 mod_tls/2.4.3[8577]: using default OpenSSL verification locations (see $SSL_CERT_DIR environment variable)
Aug 05 16:11:30 mod_tls/2.4.3[8577]: TLS/TLS-C requested, starting TLS handshake
Aug 05 16:11:30 mod_tls/2.4.3[8577]: TLSv1/SSLv3 connection accepted, using cipher DHE-RSA-AES128-SHA (128 bits)
Aug 05 08:11:31 mod_tls/2.4.3[8577]: Protection set to Private
Aug 05 08:11:31 mod_tls/2.4.3[8577]: starting TLS negotiation on data connection
Aug 05 08:11:31 mod_tls/2.4.3[8577]: TLSv1/SSLv3 renegotiation accepted, using cipher DHE-RSA-AES128-SHA (128 bits)
Aug 05 08:11:31 mod_tls/2.4.3[8577]: client reused SSL session for data connection
Aug 05 08:11:31 mod_tls/2.4.3[8577]: TLSv1/SSLv3 data connection accepted, using cipher DHE-RSA-AES128-SHA (128 bits)
Aug 05 16:33:45 mod_tls/2.4.3[8609]: using default OpenSSL verification locations (see $SSL_CERT_DIR environment variable)
Aug 05 16:33:45 mod_tls/2.4.3[8609]: SSL/TLS required but absent for authentication, denying USER command
Aug 05 16:33:45 mod_tls/2.4.3[8610]: using default OpenSSL verification locations (see $SSL_CERT_DIR environment variable)
Aug 05 16:34:48 mod_tls/2.4.3[8611]: using default OpenSSL verification locations (see $SSL_CERT_DIR environment variable)
Aug 05 16:34:48 mod_tls/2.4.3[8611]: TLS/TLS-C requested, starting TLS handshake
Aug 05 16:34:48 mod_tls/2.4.3[8611]: client supports secure renegotiations
Aug 05 16:34:48 mod_tls/2.4.3[8611]: TLSv1/SSLv3 connection accepted, using cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)
Aug 05 08:35:11 mod_tls/2.4.3[8611]: Protection set to Private
Aug 05 08:35:11 mod_tls/2.4.3[8611]: starting TLS negotiation on data connection
Aug 05 08:35:11 mod_tls/2.4.3[8611]: TLSv1/SSLv3 renegotiation accepted, using cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)
Aug 05 08:35:11 mod_tls/2.4.3[8611]: client reused SSL session for data connection
Aug 05 08:35:11 mod_tls/2.4.3[8611]: TLSv1/SSLv3 data connection accepted, using cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)