首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VSFTPD FileZilla GnuTLS错误-15 (收到意外的TLS数据包)

VSFTPD FileZilla GnuTLS错误-15 (收到意外的TLS数据包)
EN

Unix & Linux用户
提问于 2016-03-17 22:09:51
回答 7查看 29.4K关注 0票数 11

我同时设置了两个新的CentOS 7框,因此配置应该是相同的,只是不同的ip地址和主机名。

我安装了VSFTPD并配置为被动端口。一个盒子连接得很好,没有问题,但是第二个盒子不断抛出这个错误:

代码语言:javascript
复制
GnuTLS error -15: An unexpected TLS packet was received.

以下是调试FileZilla跟踪:

代码语言:javascript
复制
Status: Connecting to 192.168.20.68:21...
Status: Connection established, waiting for welcome message...
Trace:  CFtpControlSocket::OnReceive()
Response:   220 (vsFTPd 3.0.2)
Trace:  CFtpControlSocket::SendNextCommand()
Command:    AUTH TLS
Trace:  CFtpControlSocket::OnReceive()
Response:   234 Proceed with negotiation.
Status: Initializing TLS...
Trace:  CTlsSocket::Handshake()
Trace:  CTlsSocket::ContinueHandshake()
Trace:  CTlsSocket::OnSend()
Trace:  CTlsSocket::OnRead()
Trace:  CTlsSocket::ContinueHandshake()
Trace:  CTlsSocket::OnRead()
Trace:  CTlsSocket::ContinueHandshake()
Trace:  CTlsSocket::OnRead()
Trace:  CTlsSocket::ContinueHandshake()
Trace:  TLS Handshake successful
Trace:  Protocol: TLS1.2, Key exchange: ECDHE-RSA, Cipher: AES-256-GCM, MAC: AEAD
Status: Verifying certificate...
Status: TLS connection established.
Trace:  CFtpControlSocket::SendNextCommand()
Command:    USER datamover
Trace:  CTlsSocket::OnRead()
Trace:  CFtpControlSocket::OnReceive()
Response:   331 Please specify the password.
Trace:  CFtpControlSocket::SendNextCommand()
Command:    PASS *******
Trace:  CTlsSocket::OnRead()
Trace:  CTlsSocket::Failure(-15)
Error:  GnuTLS error -15: An unexpected TLS packet was received.
Trace:  CRealControlSocket::OnClose(106)
Trace:  CControlSocket::DoClose(64)
Trace:  CFtpControlSocket::ResetOperation(66)
Trace:  CControlSocket::ResetOperation(66)
Error:  Could not connect to server

错误总是在密码检查之后。

我知道问题不是SELinux,因为我禁用了它。问题还不是防火墙,因为我试图禁用防火墙守护进程(firewalld)。

以下是/etc/vsftpd/vsftpd.conf文件的相关部分。

代码语言:javascript
复制
listen=YES
listen_ipv6=NO
pasv_enable=YES
pasv_max_port=10100
pasv_min_port=10090
pasv_address=192.168.20.88

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
ssl_ciphers=HIGH
require_ssl_reuse=NO

rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem

我做了谷歌搜索,但没有看到任何15个错误代码。

有什么想法?

EN

回答 7

Unix & Linux用户

回答已采纳

发布于 2016-03-18 16:56:06

我贴出这个答案是希望它能帮助将来的人,可能是我,因为我遇到了这个问题。

我没有正确地设置local_root文件中的/etc/vsftpd/vsftpd.conf。该设置指向不存在的文件夹。

通过我,我看到了FileZilla中密码命令的失败,所以我认为它不喜欢密码。让我思考正确方向的是,我花了时间研究为什么我没有收到详细的日志。我没有收到任何日志。当我开始接收调试日志时,我看到了FTP协议,我看到FTP服务器对密码说OK。遗憾的是,没有任何类型的日志记录,但我发现,在验证密码之后,协商本地根将是下一个步骤。我是对的,这让我发现了这个问题。

下面是包含本地根的/etc/vsftpd/vsftpd.conf文件中的代码片段。

代码语言:javascript
复制
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=YES
#local_root=/mnt/raid1
local_root=/ftproot
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list

下面是我最后打开详细日志记录的方式,不过为了节省磁盘空间和提高性能,我现在将关闭它。

代码语言:javascript
复制
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
xferlog_std_format=NO
log_ftp_protocol=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES

IMHO,我会认为这个评论是一个bug,因为xferlog_enable比实际上传和下载的文件更多。此属性还打开日志记录。谷歌的一项研究证明,log_ftp_protocol=YES需要xferlog_enable=YES

票数 5
EN

Unix & Linux用户

发布于 2016-09-13 18:03:15

我遇到了完全相同的错误(错误: GnuTLS错误-15:接收到了一个意外的TLS数据包)。敲了我的头大约一个小时,但后来我发现ftp用户主页目录,是在Gluster卷上没有挂载。安装砂糖卷和问题解决。

票数 1
EN

Unix & Linux用户

发布于 2018-01-25 11:39:58

您需要允许配置文件中的可写chroot:

代码语言:javascript
复制
sudo nano /etc/vsftpd.conf

然后在底部添加这一行:

代码语言:javascript
复制
allow_writeable_chroot=YES

然后,重新启动服务:

代码语言:javascript
复制
sudo service vsftpd restart
票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/270539

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档