vsftpd-GnuTLS错误-15:收到意外的TLS数据包


11

当我尝试连接到filezila上的ftp服务器时,如何解决此错误:

GnuTLS error -15: An unexpected TLS packet was received.

和崇高ftpsync插件上的此错误:

ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1515)

这是我的vsftpd设置:

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
nopriv_user=vsftpd
virtual_use_local_privs=YES
guest_enable=YES
user_sub_token=$USER
local_root=/var/www/$USER
chroot_local_user=YES
hide_ids=YES
guest_username=vsftpd

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

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

require_ssl_reuse=NO
ssl_ciphers=HIGH

Answers:


11

我尝试在配置文件中添加一行。在此处打开配置:

sudo nano /etc/vsftpd.conf

并将此行放在底部:

allow_writeable_chroot=YES

之后,重新启动服务:

sudo service vsftpd restart

那为我解决了。


这也适用于Centos7和vsftpd 3.0.2。
Putnik

4

可能是您的错误与SSL无关。

  1. 尝试停用SSL(ssl_enable=NO
  2. 与您喜欢的FTP客户端连接。

然后,您可能会看到真正的错误。

这就是Francisc IB答案与SSL无关的原因。


对我来说,这是最好的答案:错误的配置会导致GnuTLS -15错误,并且禁用TLS会提供更多适当的信息
lauhub

0

对我来说很奇怪,这个问题ls在登录后尝试出现。

原来是我卸载httpd了,nginx而我正在使用的文件夹归所有者所有,apache:apache并且在删除时删除了该用户httpd。我chcon将目录移到nginx:nginx配置文件中的以下各行中,然后替换了用户: guest_username=nginx nopriv_user=nginx

希望这对外面的人有帮助,因为错误消息根本没有帮助。


0

我发现了很多令人困惑的答案。我会发布一个

/etc/vsftpd.conf

在2019-09-04使用fileZilla作为客户端的Ubuntu 18.04中,对我来说完美无瑕。FTPS部署在一个EC2实例中,该实例由一个非常严格的安全组监管,该安全组仅允许特定的公共IPS进行访问。

# FTPS Shim TLS configuration /etc/vsftpd.conf
# Run standalone?  vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
listen=YES
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=NO
listen_port=38250
ftp_data_port=38255
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO
# Uncomment this to allow local users to log in.
local_enable=YES
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
# If enabled, vsftpd will display directory listings with the time
# in  your  local  time  zone.  The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
use_localtime=YES
# 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
# You may override where the log file goes if you like. The default is shown below.
xferlog_file=/var/log/vsftpd.log
log_ftp_protocol=YES
debug_ssl=YES
# You may change the default value for timing out an idle session.
idle_session_timeout=600
# You may change the default value for timing out a data connection.
data_connection_timeout=120
# You may fully customise the login banner string:
ftpd_banner=Welcome to Read-Only FTPS Shim service.
# You may restrict local users to their home directories.  See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
chroot_local_user=YES
allow_writeable_chroot=YES
# This option should be the name of a directory which is empty.  Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd/empty
# This string is the name of the PAM service vsftpd will use.
pam_service_name=ftp
# FTPS Passive Mode. -Define port range for passive mode connections
pasv_enable=Yes
pasv_min_port=10100
pasv_max_port=10110
ssl_enable=YES
# force client to use TLS when logging in
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
require_ssl_reuse=NO
ssl_ciphers=HIGH
# specify TSL certificate/private key
rsa_cert_file=/etc/ssl/certs/fullchain.pem
rsa_private_key_file=/etc/ssl/private/privkey.pem
force_local_logins_ssl=YES
force_anon_logins_ssl=YES
# Uncomment this to indicate that vsftpd use a utf8 filesystem.
utf8_filesystem=YES
# Users
userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
userlist_deny=NO

0

我遇到了同样的问题。出于安全考虑,另一个线程建议不要设置allow_writeable_chroot = YES,即减轻“ ROARING BEAST ATTACK”。

设置allow_writeable_chroot = YES意味着vsftpd应该允许该用户可写用户主目录的情况。相反,出于安全原因,我将用户根文件夹的权限从777更改为555。

原始文件:drwxrwxrwx / home / ftpuser /

更改为:dr-xr-xr-x / home / ftpuser /

这使得用户的主目录不可被用户写入,因此我不必使用allow_writeable_chroot = YES参数。就我的情况而言,这很好(并且更安全),因为我具有预设的目录结构,并且不希望用户始终在其根文件夹中创建新文件或目录。

当我通过vsftpd 的local_root = [path]参数将主目录切换到/ var / ftp时,我发现了这一点,并且无需设置allow_writeable_chroot = YES就可以正常工作。该文件夹/ var / ftp是(755),但由root拥有,因此ftpuser无法写入。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.