企业网站模板 首页大图,曲阜市住房和城乡建设局网站,南宁有名的网络公司,wordpress插件获取数据库vsftpd 作为一个主打安全的FTP服务器#xff0c;有很多的选项设置。下面介绍了vsftpd的配置文件列表#xff0c;而所有的配置都是基于vsftpd.conf这个配置文件 的。本文将提供完整的vsftpd.conf的中文说明。学习本文的内容将有助于你初步了解vsftpd的配置文件#xff0c;但针… vsftpd 作为一个主打安全的FTP服务器有很多的选项设置。下面介绍了vsftpd的配置文件列表而所有的配置都是基于vsftpd.conf这个配置文件 的。本文将提供完整的vsftpd.conf的中文说明。学习本文的内容将有助于你初步了解vsftpd的配置文件但针对具体情况还需要制定具体的配置 方法。 Vsftpd的配置文件 /etc/vsftpd/vsftpd.conf 主配置文件 /usr/sbin/vsftpd Vsftpd 的主程序 /etc/rc.d/init.d/vsftpd 启动脚本 /etc/pam.d/vsftpd PAM 认证文件此文件中file/etc/vsftpd/ftpusers字段指明阻止访问的用户来自/etc/vsftpd/ftpusers文件中的用户 /etc/vsftpd/ftpusers 禁止使用vsftpd 的用户列表文件。记录不允许访问FTP服务器的用户名单管理员可以把一些对系统安全有威胁的用户账号记录在此文件中以免用户从FTP登录后获得大于上传下载操作的权利而对系统造成损坏。注意 linux-4 中此文件在 /etc/ 目录下 /etc/vsftpd/user_list 禁止或允许使用vsftpd 的用户列表文件。这个文件中指定的用户缺省情况即在/etc/vsftpd/vsftpd.conf 中设置userlist_denyYES 下也不能访问FTP服务器在设置了userlist_denyNO 时,仅允许user_list 中指定的用户访问FTP 服务器。注意 linux-4 中此文件在 /etc/ 目录下 /var/ftp 匿名用户主目录本地用户主目录为/home/ 用户主目录 即登录后进入自己家目录 /var/ftp/pub 匿名用户的下载目录此目录需赋权根chmod 1777 pub 1 为特殊权限使上载后无法删除 /etc/logrotate.d/vsftpd.log Vsftpd 的日志文件 vsftpd 的主配置文件/etc/vsftpd/vsftpd.conf 说明( 修改前先备份) # Example config file /etc/vsftpd/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 vsftpds # capabilities. # Allow anonymous FTP? (Beware - allowed by default if you comment this out). anonymous_enableYES 是否允许 匿名登录FTP服务器默认设置为YES允许即用户可使用用户名ftp或anonymous进行ftp登录口令为用户的E-mail地址。如不允许匿名访问去掉前面#并设置为NO # Uncomment this to allow local users to log in. local_enableYES 是否允许本地用户 ( 即 linux 系统中的用户帐号) 登录FTP服务器默认设置为YES允许 本地用户登录后会进入用户主目录而匿名用户登录后进入匿名用户的下载目录/var/ftp/pub 若只允许匿名用户访问前面加上#可 阻止本地用户访问FTP服务器。 # Uncomment this to enable any form of FTP write command. write_enableYES 是否允许本地用户对 FTP 服务器文件具有写权限 默认设置为 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 ftpds) # local_umask022 或其它值设置本地用户的文件掩码 为缺省022 也可根据个人喜好将其设置为其他值默认值为077 # 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_enableYES 是否允许匿名用户上传文件 须将 write_enableYES 默认设置为 YES 允许 # Uncomment this if you want the anonymous FTP user to be able to create # new directories. #anon_mkdir_write_enableYES 是否允许匿名用户创建新文件夹 默认设置为 YES 允许 # Activate directory messages - messages given to remote users when they # go into a certain directory. #dirmessage_enableYES 是否激活目录欢迎信息功能 当用户用 CMD 模式首次访问服务器上某个目录时 FTP 服务器将显示欢迎信息 默认情况下 欢迎信息是通过 该 目录下的 .message 文件获得的此文件保存自定义的欢迎信息由用户自己建立 # Activate logging of uploads/downloads. xferlog_enableYES 默认值为 NO 如果启用此选项系统将会维护记录服务器上传和下载情况的日志文件默认情况该日志文件为/var/log/vsftpd.log,也可以通过下面的 xferlog_file选项对其进行设定。 # Make sure PORT transfer connections originate from port 20 (ftp-data). connect_from_port_20YES 设定 FTP 服务器将启用 FTP 数据端口的连接请求 ,ftp-data 数据传输 21 为连接控制端口 # 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!-注意不推荐使用root用户上传文件 #chown_uploadsYES 设定是否允许 改变 上传文件的属主 与下面一个设定项配合使用 #chown_usernamewhoeve r 设置想要改变的上传文件的属主 如果需要 则输入一个系统用户名 例如可以把上传的文件都改成 root 属主。whoever任何人 # You may override where the log file goes if you like. The default is shown # below. #xferlog_file/var/log/vsftpd.log ( 设定系统维护记录FTP服务器上传和下载情况的日志文件/var/log/vsftpd.log是默认的也可以另设其它) # If you want, you can have your log file in standard ftpd xferlog format #xferlog_std_formatYES 如果启用此选项 传输日志文件将以标准 xferlog 的格式书写该格式的日志文件默认为/var/log/xferlog,也可以通过xferlog_file选项对其进行设定默认值为NO #dual_log_enable ( 如果添加并启用此选项将生成两个相似的日志文件默认在/var/log/xferlog和/var/log/vsftpd.log目录下。前者是wu_ftpd类型的传输日志可以利用标准日志工具对其进行分析后者是vsftpd类型的日志) #syslog_enable ( 如果添加并启用此选项则原本应该输出到/var/log/vsftpd.log中的日志将输出到系统日志中) # You may change the default value for timing out an idle session. #idle_session_timeout600 设置数据传输中断间隔时间此语句表示空闲的用户会话中断时间为600秒即当数据传输结束后用户连接FTP服务器的时间不应超过600秒可以根据实际情况对该值进行修改 # You may change the default value for timing out a data connection. #data_connection_timeout120 设置数据连接超时时间 该语句表示数据连接超时时间为 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_userftpsecure 运行 vsftpd 需要的非特权系统用户缺省是nobody # 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_enableYES 如果 FTP client 会下达“async ABOR”这个指令时这个设定才需要启用而一般此设定并不安全所以通常将其取消 # 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_enableYES 大多数 FTP 服务器都选择用 ASCII 方式传输数据 将 # 去掉就能实现用 ASCII 方式上传和下载文件 #ascii_download_enableYES 将 # 去掉就能实现用 ASCII 方式下载文件 # You may fully customise the login banner string: #ftpd_bannerWelcome to blah FTP service. 将#去掉可设置登录FTP服务器时显示的欢迎信息可以修改后的欢迎信息内容。另外如在需要设置更改目录欢迎信息的目录下创建名为 .message 的文件并写入欢迎信息保存后在进入到此目录会显示自定义欢迎信息 # You may specify a file of disallowed anonymous e-mail addresses. Apparently # useful for combatting certain DoS attacks. #deny_email_enableYES 可将某些特殊的 email address 抵挡住。如果以anonymous登录服务器时会要求输入密码也就是您的email address,如果很讨厌某些email address就可以使用此设定来取消他的登录权限但必须与下面的设置项配合 # (default follows) #banned_email_file/etc/vsftpd/banned_emails 当上面的 deny_email_enableYES 时可以利用这个设定项来规定那个email address不可登录vsftpd服务器此文件需用户自己创建一行一个email address即可 # 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(). #chroot_list_enableYES 设置为 NO 时用户登录FTP服务器后具有访问自己目录以外的其他文件的权限 设置为 YES 时 用户被锁定在自己的 home 目录中vsftpd将在下面 chroot_list_file选项值的位置寻找 chroot_list文件此文件需用户建立,再将需锁定在自己home目录的用户列入其中每行一个用户 # (default follows) #chroot_list_file/etc/vsftpd/chroot_list 此文件需自己建立 被列入此文件的用户 在登录后将不能切换到自己目录以外的其他目录 由 FTP 服务器自动地 chrooted 到用户自己的home目录下使得 chroot_list文件中的用户不能随意转到其他用户的FTP home目录下从而有利于FTP服务器的安全管理和隐私保护 # 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_enableYES 是否允许递归查询 大型站点的 FTP 服务器启用此项可以方便远程用户查询 # When listen directive is enabled, vsftpd runs in standalone mode and # listens on IPv4 sockets. This directive cannot be used in conjunction # with the listen_ipv6 directive. listenYES 如果设置为 YES 则 vsftpd 将以独立模式运行由vsftpd自己监听和处理连接请求 # This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6 # sockets, you must run two copies of vsftpd whith two configuration files. # Make sure, that one of the listen options is commented !! #listen_ipv6YES ( 设定是否支持IPV6) #pam_service_namevsftpd 设置 PAM 外挂模块提供的认证服务所使用的配置文件名 即/etc/pam.d/vsftpd文件此文件中file/etc/vsftpd/ftpusers字段说明了PAM模块能抵挡的帐号内容来自文件/etc/vsftpd/ftpusers中 #userlist_enableYES/NO 此选项默认值为NO ,此时ftpusers文件中的用户禁止登录FTP服务器若此项设为YES则 user_list文件中的用户允许登录 FTP服务器而如果同时设置了 userlist_denyYES 则 user_list文件中的用户将不允许登录FTP服务器甚至连输入密码提示信息都没有直接被FTP服务器拒绝 #userlist_denyYES/NO 此项默认为YES设置是否阻扯user_list文件中的用户登录FTP服务器 tcp_wrappersYES 表明服务器使用 tcp_wrappers 作为主机访问控制方式tcp_wrappers可以实现linux系统中网络服务的基于主机地址的访问控制在/etc目录中的 hosts.allow和hosts.deny两个文件用于设置tcp_wrappers的访问控制前者设置允许访问记录后者设置拒绝访问记录。例如 想限制某些主机对FTP服务器192.168.57.2的匿名访问编缉/etc/hosts.allow 文件如在下面增加两行命令vsftpd:192.168.57.1ENY 和vsftpd:192.168.57.9ENY 表明限制IP为192.168.57.1/192.168.57.9主机访问IP为192.168.57.2的FTP服务器此时FTP服务器虽可以PING通但无法连接 转载于:https://www.cnblogs.com/lvdongjie/p/3772291.html