我已经在服务器上将vsftpd安装为ftps服务器。从客户端,我尝试使用lftp这样连接到服务器:
$ lftp
lftp :~> set ftps:initial-prot "";
lftp :~> set ftp:passive-mode true;
lftp :~> set ftp:ssl-force true;
lftp :~> set ftp:ssl-protect-list yes;
lftp :~> set ftp:ssl-protect-data yes;
lftp :~> set ssl:verify-certificate no;
lftp :~> set ssl:check-hostname false;
lftp :~> open ftps://XX:XX:XX:XX:990
lftp 10.12.25.127:~> user ftpser pwd
这总是会导致错误
Fatal error: gnutls_handshake: An unexpected TLS packet was received.
经过数小时的尝试不同的选择,我发现将打开的网址从ftps://XX.XX.XX.XX:990
更改为ftp://XX.XX.XX.XX:990
后,错误会消失
我的问题是:
非常感谢Ruud
我的vsftpd.conf包含:
listen=NO
listen_port=990
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
#rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
#rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
rsa_cert_file=/etc/ssl/private/vsftpdCertificate.pem
rsa_private_key_file=/etc/ssl/private/vsftpdServerkey.pem
ssl_enable=yes
ssl_ciphers=HIGH
ssl_tlsv1=yes
ssl_sslv2=no
ssl_sslv3=no
force_local_data_ssl=yes
force_local_logins_ssl=yes