vsftpd.conf参数配置

news2024/9/20 11:32:35

文章目录

    • 初始vsftdp.conf
      • 翻译后
      • 需修改参数
        • write_enable=YES(启用任何形式的FTP写入命令)
        • userlist_file=/etc/vsftpd.user_list、userlist_enable=YES、userlist_deny=NO
        • local_umask=022(放开权限)
        • chroot_local_user=YES(限定目录)(为了安全最好启用)
          • chroot的含义
        • pasv_enable=YES、pasv_min_port=40000、pasv_max_port=50000(为了方便,最好打开?)
        • allow_writeable_chroot=YES(允许用户在chroot环境中创建或修改文件)
        • local_root=/home/ftp(指定限制根目录)(如果设置了chroot_local_user=YES,则没有必要)
        • listen=YES、listen_ipv6=NO、pasv_address=192.168.1.140(配置被动模式时,需要设置这个?)
          • 关于listen=YES
            • vsftpd可以以两种方式运行:独立守护进程和inetd方式
          • 关于什么情况下要设置listen_ipv6=NO
    • 修改后vsftpd.conf(服务器容器方案1:支持passive被动模式)

我ubuntu20.04默认安装的是:vsftpd_3.0.3-12_amd64.deb(ubuntu16.04安装的也是相同版本)

在这里插入图片描述

初始vsftdp.conf

# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
#
# Run standalone?  vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=NO
#
# 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_ipv6=YES
#
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
#write_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
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# 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
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# 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=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
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# 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
#
# 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
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# Customization
#
# Some of vsftpd's settings don't fit the filesystem layout by
# default.
#
# 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=vsftpd
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO

#
# Uncomment this to indicate that vsftpd use a utf8 filesystem.
#utf8_filesystem=YES

翻译后

# 示例配置文件 /etc/vsftpd.conf
#
# 默认编译设置相当谨慎。这个示例文件
# 放松了一些限制,使ftp守护进程更易于使用。
# 请参阅vsftpd.conf.5以获取所有编译的默认值。
#
# 请阅读:这个示例文件不是vsftpd选项的详尽列表。
# 请阅读vsftpd.conf.5手册页,以全面了解vsftpd的功能。
#
#
# 独立运行?vsftpd可以从inetd或作为独立运行
# 守护进程从initscript启动。
listen=NO
#
# 此指令启用IPv6套接字上的侦听。默认情况下,侦听
# 在IPv6“任何”地址(::)上将接受来自IPv6和IPv4客户端的连接。它不必在*上侦听
# IPv4和IPv6套接字。如果您想要这样做(可能是因为您想要侦听特定的
# 地址),那么您必须运行两个vsftpd副本,每个副本都有两个配置
# 文件。
listen_ipv6=YES
#
# 允许匿名FTP?(默认情况下禁用)。
anonymous_enable=NO
#
# 取消注释此选项以允许本地用户登录。
local_enable=YES
#
# 取消注释此选项以启用任何形式的FTP写入命令。
#write_enable=YES
#
# 本地用户的默认umask为077。您可能希望将其更改为022,
# 如果您的用户期望(022由大多数其他ftpd使用)
#local_umask=022
#
# 取消注释此选项以允许匿名FTP用户上传文件。这只有
# 如果上面的全局写入启用已激活才会生效。此外,您将
# 显然需要创建一个FTP用户可写的目录。
#anon_upload_enable=YES
#
# 如果要使匿名FTP用户能够创建新目录,请取消注释此选项。
#anon_mkdir_write_enable=YES
#
# 激活目录消息-当他们进入某个目录时向远程用户发送的消息。
dirmessage_enable=YES
#
# 如果启用,vsftpd将在本地时区中显示带有时间的目录列表
# 在GMT中显示默认值。由
# MDTM FTP命令返回的时间也受此影响
# 选项。
use_localtime=YES
#
# 激活上传/下载日志记录。
xferlog_enable=YES
#
# 确保PORT传输连接起源于端口20(ftp-data)。
connect_from_port_20=YES
#
# 如果您愿意,可以安排上传的匿名文件由不同的用户拥有。注意!使用“root”上传文件不是
# 推荐!
#chown_uploads=YES
#chown_username=whoever
#
# 如果您愿意,可以更改日志文件的默认位置。
#xferlog_file=/var/log/vsftpd.log
#
# 如果您愿意,可以将日志文件设置为标准ftpd xferlog格式。
# 请注意,在这种情况下,默认日志文件位置为/var/log/xferlog。
#xferlog_std_format=YES
#
# 您可以更改空闲会话超时的默认值。
#idle_session_timeout=600
#
# 您可以更改数据连接超时的默认值。
#data_connection_timeout=120
#
# 建议您在系统上定义一个唯一的用户,该用户
# ftp服务器可以使用作为完全隔离和无特权用户。
#nopriv_user=ftpsecure
#
# 启用此选项,服务器将识别异步 ABOR 请求。不建议使用此选项(代码较为复杂),但不启用此选项可能会使旧的 FTP 客户端混淆。
#async_abor_enable=YES
#
# 默认情况下,服务器会假装允许 ASCII 模式,但实际上会忽略该请求。打开以下选项,使服务器在 ASCII 模式下实际执行文件的 ASCII 编码。
#请注意,在某些 FTP 服务器上,ASCII 支持允许通过 ASCII 模式下的“SIZE /big/file”命令进行拒绝服务(DoS)攻击。vsftpd 预测到了这种攻击,并始终是安全的,报告原始文件的大小。
# ASCII 编码是协议的一个可怕的特性。
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# 您可以完全自定义登录横幅字符串:
#ftpd_banner=欢迎使用 blah FTP 服务。
#
# 您可以指定一个禁止匿名电子邮件地址的文件。显然,这对于打击某些 DoS 攻击很有用。
#deny_email_enable=YES
#(默认值如下)
#banned_email_file=/etc/vsftpd.banned_emails
#
# 您可以将本地用户限制在其主目录中。在使用 chroot_local_user 或 chroot_list_enable 之前,请参阅 FAQ 中可能存在的风险。
#chroot_local_user=YES
#
# 您可以指定一个显式的本地用户列表,以将其 chroot() 到其主目录中。如果 chroot_local_user 为 YES,则此列表将成为不 chroot() 的用户列表。
#(警告!chroot 可能非常危险。如果使用 chroot,请确保用户没有写入 chroot 中的顶级目录的权限)
#chroot_local_user=YES
#chroot_list_enable=YES
#(默认值如下)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# 您可以激活内置 ls 的“-R”选项。默认情况下,此选项已禁用,以避免远程用户能够在大型站点上引起过多的 I/O。但是,一些破损的 FTP 客户端(如“ncftp”和“mirror”)假定存在“-R”选项,因此有充分的理由启用它。
#ls_recurse_enable=YES
#
# 自定义
#
# 默认情况下,vsftpd 的某些设置不适合文件系统布局。
#
# 此选项应为一个空目录的名称。此外,该目录不应由 ftp 用户可写。在某些 vsftpd 不需要文件系统访问的时候,该目录用作安全的 chroot() 狱。
secure_chroot_dir=/var/run/vsftpd/empty
# (在vsftpd.conf配置文件中,secure_chroot_dir=/var/run/vsftpd/empty表示在使用chroot_local_user选项时,指定一个安全的chroot目录。这个目录是一个空目录,只包含必要的系统文件和目录,而不包含任何用户数据或配置文件。这样做可以防止用户通过FTP访问系统中的其他文件和目录,从而提高系统的安全性。当用户使用FTP登录时,如果chroot_local_user选项被启用,那么用户将被限制在其主目录中。如果没有指定secure_chroot_dir,则用户可以通过FTP访问系统中的其他文件和目录。但是,如果指定了secure_chroot_dir,则用户将被限制在/var/run/vsftpd/empty目录中,无法访问其他目录。这个目录是一个安全的chroot目录,只包含必要的系统文件和目录,可以保护系统的安全性。)
#
# 此字符串是 vsftpd 将使用的 PAM 服务的名称。
pam_service_name=vsftpd
# (在vsftpd.conf配置文件中,pam_service_name=vsftpd表示使用PAM(Pluggable Authentication Modules)进行用户身份验证时,使用的PAM服务名称为“vsftpd”。PAM是一种标准化的身份验证机制,可以让系统管理员使用不同的身份验证方法来控制用户访问系统资源的权限。在vsftpd中,可以使用PAM来进行用户身份验证,以增强系统的安全性。当pam_service_name设置为vsftpd时,vsftpd将使用名为“vsftpd”的PAM服务来进行用户身份验证。管理员可以在PAM配置文件中定义这个服务,以指定使用哪种身份验证方法。例如,可以使用本地系统账户、LDAP、Kerberos等身份验证方法来验证用户身份。这样可以提高系统的安全性,并且可以根据需要灵活地配置身份验证方法。)
#
# 此选项指定用于 SSL 加密连接的 RSA 证书的位置。
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO

#
# 取消注释此选项以指示 vsftpd 使用 utf8 文件系统。
#utf8_filesystem=YES

需修改参数

write_enable=YES(启用任何形式的FTP写入命令)

在vsftpd配置文件中,write_enable=YES表示允许用户上传文件和创建新目录。如果设置为NO,则用户只能下载文件,不能上传或创建新目录。

userlist_file=/etc/vsftpd.user_list、userlist_enable=YES、userlist_deny=NO

  • userlist_file=/etc/vsftpd.user_list:指定用户列表文件的路径,该文件中列出的用户将被允许或拒绝访问FTP服务器。
  • userlist_enable=YES:启用用户列表功能,如果设置为NO,则用户列表文件将被忽略。
  • userlist_deny=NO:指定用户列表的行为,如果设置为YES,则只有在用户列表中列出的用户将被拒绝访问FTP服务器,如果设置为NO,则只有在用户列表中列出的用户将被允许访问FTP服务器。

local_umask=022(放开权限)

在vsftpd配置文件中,local_umask参数用于设置上传文件时的默认权限掩码。默认情况下,上传的文件权限为666,上传的目录权限为777。如果设置了local_umask参数,则会根据该参数设置的掩码来计算上传文件和目录的权限。

默认的umask为077表示新建文件的权限为600,新建目录的权限为700。umask是一种权限掩码,用于控制新建文件和目录的默认权限。它是一个三位八进制数,每一位表示一种权限(读、写、执行),0表示允许,1表示禁止。umask的值是从默认权限掩码中减去的,例如,umask为077,表示从默认权限掩码中减去777,得到的结果就是新建文件的权限为600,新建目录的权限为700。这样设置可以保证新建的文件和目录只有所有者有读写执行的权限,其他用户没有任何权限。

local_umask=022表示上传的文件权限为644,上传的目录权限为755。其中,022是一个三位八进制数,表示文件权限掩码。在Linux系统中,文件权限掩码用于控制文件的默认权限。它是一个三位八进制数,每一位表示一种权限(读、写、执行),0表示允许,1表示禁止。例如,022表示允许所有者和组成员读写,其他用户只能读取;755表示所有用户都可以读、写、执行。

chroot_local_user=YES(限定目录)(为了安全最好启用)

在vsftpd.conf配置文件中,chroot_local_user=YES表示将本地用户限制在其主目录中,防止他们访问系统中的其他文件和目录。这是一种安全措施,可以防止用户访问他们不应该访问的文件和目录,从而保护系统的安全性。当chroot_local_user设置为YES时,用户登录后将被限制在其主目录中,无法访问其他目录。

chroot的含义

chroot是"change root"的缩写,意为改变根目录。在Linux和Unix系统中,chroot是一种安全机制,可以将进程限制在指定的目录中,防止其访问系统中的其他文件和目录。通过chroot机制,可以创建一个虚拟的根目录,使进程只能访问该目录及其子目录,而不能访问系统中的其他文件和目录。
在FTP服务器中,chroot机制可以用于限制用户访问其主目录以外的文件和目录。通过将用户限制在其主目录中,可以防止他们访问系统中的其他文件和目录,从而提高系统的安全性。在vsftpd中,可以使用chroot_local_user选项将本地用户限制在其主目录中。

pasv_enable=YES、pasv_min_port=40000、pasv_max_port=50000(为了方便,最好打开?)

在vsftpd.conf配置文件中,pasv_enable=YES表示启用被动模式(Passive Mode)FTP。被动模式FTP是一种FTP数据传输模式,其中客户端使用随机端口连接FTP服务器的数据端口,而不是使用标准的FTP数据端口(端口20)。这种模式可以避免由于防火墙或NAT设备的限制而导致的FTP连接问题

需要设置pasv_enable=YES的情况包括:

  • 当FTP服务器位于防火墙或NAT设备后面时,需要启用被动模式FTP,以便客户端可以连接到FTP服务器的数据端口。

  • 当FTP服务器需要与其他系统进行数据交换时,需要启用被动模式FTP,以便其他系统可以连接到FTP服务器的数据端口。

需要注意的是,如果FTP服务器没有被防火墙或NAT设备限制,并且不需要与其他系统进行数据交换,则可以不启用被动模式FTP。在这种情况下,可以将pasv_enable设置为NO,以禁用被动模式FTP。

如果您需要启用被动模式FTP,则需要在vsftpd.conf配置文件中将pasv_enable设置为YES。如果未设置,则默认情况下被动模式FTP将被禁用。

如果您已经在vsftpd.conf配置文件中设置了pasv_enable=YES,则不需要再次添加。如果未设置,则可以添加该选项并将其设置为YES。例如:

pasv_enable=YES

请注意,如果您使用被动模式FTP,则还需要在防火墙中打开FTP数据端口范围(默认情况下是端口1024到65535)。否则,客户端可能无法连接到FTP服务器的数据端口。

allow_writeable_chroot=YES(允许用户在chroot环境中创建或修改文件)

在vsftpd.conf配置文件中,allow_writeable_chroot=YES表示允许在chroot环境中创建可写文件。chroot环境是一种安全机制,可以将用户限制在其主目录中,防止他们访问系统中的其他文件和目录。但是,如果不允许在chroot环境中创建可写文件,则用户将无法在其主目录中创建或修改文件,这可能会影响其正常使用FTP服务。

当allow_writeable_chroot设置为YES时,用户可以在chroot环境中创建可写文件。这意味着用户可以在其主目录中创建或修改文件,而不会受到chroot环境的限制。这可以提高FTP服务的灵活性和可用性。

需要注意的是,允许在chroot环境中创建可写文件可能会降低系统的安全性,因为用户可以在其主目录中创建或修改任何文件。因此,如果不需要在chroot环境中创建可写文件,则建议将allow_writeable_chroot设置为NO。

local_root=/home/ftp(指定限制根目录)(如果设置了chroot_local_user=YES,则没有必要)

如果设置了chroot_local_user=YES,那么FTP用户将被限制在其主目录中,无法访问系统中的其他文件和目录。在这种情况下,设置local_root=/home/ftp可能没有必要,因为FTP用户的根目录已经被限制为其主目录。

但是,如果需要将FTP用户的根目录设置为其他目录,可以设置local_root选项。例如,如果希望FTP用户的根目录为/var/ftp,可以将local_root设置为/var/ftp。在这种情况下,FTP用户将被限制在其主目录中,同时其根目录将设置为/var/ftp。

需要注意的是,如果不需要将FTP用户的根目录设置为其他目录,可以不设置local_root选项。在这种情况下,FTP用户的根目录将默认为其主目录。

listen=YES、listen_ipv6=NO、pasv_address=192.168.1.140(配置被动模式时,需要设置这个?)

对于Linux下的vsftpd,需添加:pasvaddress=公网IP。

或者关闭PASV模式的安全检查,即:pasv_promiscuous=YES,该检查确保数据连接和控制连接是来自同一个IP地址。小心打开此选项。此选项唯一合理的用法是存在于由安全隧道方案构成的组织中。默认值为NO。

● 注意:当使用pasv_address指定公网IP时,必须将监听的IP地址改为IPv4,即:listen=YES,否则vsftpd将返回错误的被动套接字,如:227 Entering Passive Mode (0,0,0,0,34,198).。而启用IPv4地址时则需要禁用IPv6地址的监听,因为两者互斥。

listen=YES        #指定被动模式时的公网IP地址时只能监听在IPv4地址
listen_ipv6=NO    #与listen冲突,默认监听IPv6地址,当监听在IPv4时IPv6必须禁用,否则vsftpd.service将无法启动
 
pasv_enable=YES
pasv_min_port=8900
pasv_max_port=8909
pasv_address=47.95.120.253       #指定被动模式时的公网IP地址
#pasv_addr_resolve=YES
#pasv_promiscuous=YES

参考文章:被动模式下FTP不能建立数据会话问题

这样设置,果真可以了:

在这里插入图片描述

关于listen=YES

具体来说,listen=NO表示vsftpd服务不以inetd方式运行,而是以独立守护进程的方式运行。如果将listen设置为YES,则表示vsftpd服务以inetd方式运行。

vsftpd可以以两种方式运行:独立守护进程和inetd方式

独立守护进程方式是指vsftpd作为一个独立的进程运行,它会一直在后台运行,等待客户端的连接请求。这种方式的优点是可以提高服务的响应速度和并发处理能力,因为它不需要每次都重新启动一个新的进程来处理客户端的请求。

inetd方式是指vsftpd作为inetd的一个服务运行,每当有客户端连接请求时,inetd会启动一个新的vsftpd进程来处理该请求。这种方式的优点是可以节省系统资源,因为它只在需要时才会启动一个新的进程来处理客户端请求。

总的来说,独立守护进程方式适合处理高并发的情况,而inetd方式适合处理低并发的情况。在实际应用中,可以根据具体的需求来选择合适的运行方式。

关于什么情况下要设置listen_ipv6=NO

listen_ipv6是vsftpd.conf配置文件中的一个选项,用于指定是否启用IPv6监听。如果将listen_ipv6设置为YES,则表示vsftpd服务将同时监听IPv4和IPv6地址;如果将其设置为NO,则表示vsftpd服务只监听IPv4地址。

在一些特定的情况下,可能需要将listen_ipv6设置为NO,例如:

  1. 系统不支持IPv6:如果系统不支持IPv6,那么启用IPv6监听是没有意义的,此时应该将listen_ipv6设置为NO

  2. 安全性考虑:如果系统管理员认为IPv6网络存在安全风险,或者不希望vsftpd服务被IPv6地址访问,那么可以将listen_ipv6设置为NO,只允许IPv4地址访问。

  3. 性能考虑:如果系统的网络环境中只有IPv4地址,那么启用IPv6监听会增加系统的负担,此时可以将listen_ipv6设置为NO,以提高系统的性能。

需要注意的是,如果系统同时支持IPv4和IPv6,而listen_ipv6被设置为NO,那么只有IPv4地址能够访问vsftpd服务,IPv6地址将无法访问。如果需要同时支持IPv4和IPv6,那么应该将listen_ipv6设置为YES

修改后vsftpd.conf(服务器容器方案1:支持passive被动模式)

# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
#
# Run standalone?  vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.

# origin
# listen=NO

# arnold modified 20230430
listen=YES

#
# 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.
# origin
# listen_ipv6=YES

listen_ipv6=NO
#
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
#write_enable=YES

#arnold modified 20230227
write_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

# arnold modified 20230428
local_umask=022

#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# 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
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# 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=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
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# 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

# arnold modified 20230428
chroot_local_user=YES

#
# 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
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# Customization
#
# Some of vsftpd's settings don't fit the filesystem layout by
# default.
#
# 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=vsftpd
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO

#
# Uncomment this to indicate that vsftpd use a utf8 filesystem.
#utf8_filesystem=YES

# arnold add 20230227
userlist_file=/etc/vsftpd.user_list
userlist_enable=YES
userlist_deny=NO

# arnold add 20230428
pasv_enable=YES
pasv_min_port=60001
pasv_max_port=60100

# arnold add 202300430 # for test
pasv_address=192.168.1.140
# pasv_addr_resolve=YES
# pasv_promiscuous=YES


# arnold add 20230428
allow_writeable_chroot=YES

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/480847.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

每日学术速递4.29

CV - 计算机视觉 | ML - 机器学习 | RL - 强化学习 | NLP 自然语言处理 Subjects: cs.LG 1.A Cookbook of Self-Supervised Learning 标题:自监督学习食谱 作者:Randall Balestriero, Mark Ibrahim, Vlad Sobal, Ari Morcos, Shashank Shekhar, Tom…

学知识变现,看完这些就够了

点击查看【18本知识变现电子书】 100个实用知识点 60万字知识变现精华 资深知识变现教练海哥扛鼎之作 2000多位学员实战经验干货总结 从理论到实践,从思维到实操 教你彻底学透如何知识变财富 .......... 全网最全知识变现知识付费电子教程 资深知识变现教练海…

Linux线程相关函数:线程的创建、属性、回收、退出、取消

1. 线程号 进程号在系统中唯一&#xff0c;但线程号只在其所属进程环境中有效。 &#xff08;1&#xff09;pthread_self函数 #include<pthread.h>pthread_t pthread_self(void); /* 功能&#xff1a;获取线程号 返回值&#xff1a;调用此函数线程的ID */ pthread_se…

【Unity-UGUI控件全面解析】| Panel 容器组件详解

🎬【Unity-UGUI控件全面解析】| Panel 容器组件详解一、组件介绍二、组件属性面板三、代码操作组件💯总结🎬 博客主页:https://xiaoy.blog.csdn.net 🎥 本文由 呆呆敲代码的小Y 原创,首发于 CSDN🙉 🎄 学习专栏推荐:Unity系统学习专栏 🌲 游戏制作专栏推荐:游…

2007-2020年上市公司数字经济化指标含原始数据和计算代码(do文档)

2007-2020年上市公司数字经济化指标含原始数据和计算代码&#xff08;do文档&#xff09; 1、时间&#xff1a;2007-2020 2、范围&#xff1a;A股上市公司剔除jin rong行业 3、数据说明&#xff1a;包含计算过程和原始数据 4、参考文献&#xff1a;祁怀锦,数字经济对公司治…

利用C#实现动态替换桌面快捷方式对应的应用程序

公司有一个特殊的业务可能会用到这个&#xff0c;至于什么业务就不展开了。本文的内容作为备用方案。 实现思路&#xff1a; 1 获取当前exe程序运行的全路径 2 获取桌面的所有快捷方式 3 遍历快捷方式&#xff0c;获取快捷键方式对应程序的运行路径&#xff0c;并与当前…

【开发工具】 今天我要教会你安装Office 2021 RTM 专业增强零售版 你开不开心

&#x1f680; 个人主页 极客小俊 ✍&#x1f3fb; 作者简介&#xff1a;web开发者、设计师、技术分享博主 &#x1f40b; 希望大家多多支持一下, 我们一起进步&#xff01;&#x1f604; &#x1f3c5; 如果文章对你有帮助的话&#xff0c;欢迎评论 &#x1f4ac;点赞&#x1…

统一请求封装和pytest入门使用

统一请求封装解决的问题 解决多个py文件共享session的问题 统计请求的数据 统一异常处理 统一日志监控 封装 在项目文件中创建一个common文件夹&#xff0c; 用来进行统一接口封装 import requestsclass RequestUtil:# 调用底层的requests.session()方法进行封装sess r…

超详细的R语言svykm函数绘制复杂抽样设计数据cox回归生存曲线(Kaplan-Meier)

我们在既往的文章《R语言绘制复杂抽样设计数据cox回归生存曲线(Kaplan-Meier)》中介绍了怎么使用jskm包的svykm函数绘制复杂抽样设计数据cox回归生存曲线(Kaplan-Meier)&#xff0c;但是有粉丝觉得讲得不够详细&#xff0c;希望讲得详细一点&#xff0c;今天我们继续来介绍一下…

flinkCDC在Delta.io中是什么 是CDF

类似flink CDC databricks 官方文档: How to Simplify CDC With Delta Lakes Change Data Feed - The Databricks Blog delta.io 官方文档: Change data feed — Delta Lake Documentation 概述 更改数据馈送 (CDF) 功能允许 Delta 表跟踪 Delta 表版本之间的行级更改 在…

vue+element-plus角色权限管理分配

这里的图片是截图这个老师的项目 在src/uitls/permission.js加入以下内容 本段代码讲解: 参数一:后台传来的路由 参数二:前端所有的路由 先遍历前端所有路由,在里面继续遍历后台路由,通过二者某一个关键字的是否相同判断用户是否有权限(这里老师使用的是title关键字),关键字相…

21安徽练习

题目分为4部分 APK 集群 流量 exe 我尽量都做一下&#xff0c;逆向不是很会&#xff0c;就当提升自己。 [填空题]请获取app安装包的SHA256校验值&#xff08;格式&#xff1a;不区分大小写&#xff09;&#xff08;10分&#xff09; e15095d49efdccb0ca9b2ee125e4d8136cac5…

树莓派Pico W无线开发板MQTT协议通信MicroPython编程实践

本博文介绍采用ThonnyMicroPython和umqtt.simple库MQTTClient类的对象方法编制树莓派Pico W无线开发板MQTT协议通信程序&#xff0c;将Pico W无线开发板、电脑或Android手机无线连接到远程MQTT服务器&#xff0c;给出采用电脑MQTTX应用程序及手机Android MQTT客户端App远程控制…

用python的QT做界面

文章目录 入口文件界面参数调整数据从dat解析出来的文件从界面点击打开文件夹的功能实现主要功能代码网络参数存图替换功能&#xff0c;比如把倒频谱替换成倒频谱2 入口文件 入口文件&#xff0c;主要用来实例化窗口&#xff08;不重要&#xff09;&#xff0c;只要知道从这里…

每日学术速递4.30

CV - 计算机视觉 | ML - 机器学习 | RL - 强化学习 | NLP 自然语言处理 Subjects: cs.CV 1.Masked Frequency Modeling for Self-Supervised Visual Pre-Training(ICLR 2023) 标题&#xff1a;用于自监督视觉预训练的掩蔽频率建模 作者&#xff1a;Jiahao Xie, Wei Li, Xi…

SwiftUI 设计和调试复杂界面的基本技巧示例

功能需求 对于比较复杂的 SwiftUI 界面,我们需要在充分了解 SwiftUI 各个视图基本特性的同时,合理利用 Xcode 强大的预览(Preview)机制,实时且全面的测试所有场景下的显示情况。 如上图所示:我们在 App 支持的每种语言环境中都对界面进行了全面的测试,并解决了 Cell 里…

使用Lambda表达式mutable有感

使用Lambda表达式mutable有感 在学Qt的时候&#xff0c;我看着mutable陷入了沉思&#xff0c;总觉得它和C中的某个特性很像&#xff1f;没错&#xff0c;就是 深拷贝 如果你忘记了深拷贝和浅拷贝是什么&#xff0c;那跟着我来一起回忆一下吧。首先来看深拷贝与浅拷贝的概念 浅…

从零开始学习Linux运维,成为IT领域翘楚(四)

文章目录 &#x1f525;Linux路径&#x1f525;Linux处理文件目录的常用命令&#x1f525;Linux文件编辑工具vi/vim&#x1f525;Linux文件内容查看命令 &#x1f525;Linux路径 路径&#xff0c;顾名思议&#xff0c;是指从树形目录中的某个目录层次到某个文件的一条道路。 Li…

设计模式-工厂、装饰模式

一. 设计模式-工厂模式 package com.factory.pattern;/**目标&#xff1a;工厂模式。什么是工厂设计模式&#xff1f;工厂模式&#xff08;Factory Pattern&#xff09;是 Java 中最常用的设计模式之一。这种类型的设计模式属于创建型模式&#xff0c;它提供了一种创建对象的方…

Spring 5 笔记 - AOP

1. AOP 简介 AOP&#xff1a;Aspect Oriented Programming&#xff0c; 面向切面编程或面向方面编程。利用AOP可以对业务逻辑的各个部分进行隔离&#xff0c;从而使得业务逻辑各部分之间的耦合度降低&#xff0c;提高程序的可重用性&#xff0c;同时提高了开发的效率。 将日志…