您的位置:首页 > 编程语言 > PHP开发

RHEL4- FTP服务(七)vsftpd配置文件详解(默认版)

2009-07-13 11:08 756 查看
vsftpd配置文件详解(默认版)

经过一个月的资料查阅和大量的实验排查,加上周末两天的集中整理,根据自己的工作经验翻译并写出了这个默认版的vsftp配置文件详解,此文前半部分为安装vsftpd服务后原汁原味的默认的vsftpd.conf配置文件中的所有内容,后半部分为默认vsftpd.conf配置文件中每一个语句参数的详细解释。希望大家可以在配置vsftp服务器的过程中灵活应用这些配置语句,以实现vsftp服务器更高的性能和效果。由于平时工作比较忙加上时间比较仓促和理解上的差别,在整理总结的过程中难免会出现bug,请大家发现后及时在留言中加以纠正!

原文:

******************************************************************************
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 vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
wirte_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
#
# 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
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 turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#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 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_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

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES

******************************************************************************

译文:

1、anonymous_enable=YES
(说明:控制是否允许匿名用户登入,YES 为允许匿名登入,NO 为不允许。默认值为yes。)

2、local_enable=YES
(说明:控制是否允许本地用户登入,YES 为允许本地用户登入,NO为不允许。默认值为YES。)

3、write_enable=YES
(说明:是否允许登陆用户有写权限,属于全局设置,YES 为允许登录用户有写权限,NO为不允许。默认值为YES。)

4、local_umask=022
(说明:本地用户新增文件时的umask 值,也可以说是FTP上本地的文件权限,默认值为077)

5、#anon_upload_enable=YES
(注意:设置是否改变匿名用户上传文件(非目录)的属主。Yes为允许上传,no为不允许上传。默认该语句是被注释的,默认值为yes。)

6、#anon_mkdir_write_enable=YES
(注意:可创建目录的同时可以在此目录中上传文件。如果设为YES,则允许匿名登入者有新增目录的权限,只有在write_enable=YES时,此项才有效。当然,匿名用户必须要有对上层目录的写入权。默认该语句是被注释的,默认值为yes。)

7、dirmessage_enable=YES
(注意:切换目录时,显示目录下.message的内容。如果启动这个选项,那么使用者第一次进入一个目录时,会检查该目录下是否有.message这个档案,如果有,则会出现此档案的内容,通常这个档案会放置欢迎话语,或是对该目录的说明。默认值为开启。)

8、xferlog_enable=YES
(注意:是否启用上传/下载日志记录。如果启用,则上传与下载的信息将被完整纪录在xferlog_file 所定义的档案中。预设为开启,即yes。)

9、connect_from_port_20=YES
(注意:启用FTP数据端口的数据连接 。指定FTP使用20端口进行数据传输,默认值为YES。)

10、#chown_uploads=YES
(注意:是否允许改变上传文件的所有者。默认值为yes。)

11、#chown_username=whoever
(注意:改变上传文件的所有者为谁?等号后面的参数是制定用户名。)

12、#xferlog_file=/var/log/vsftpd.log
(注意:设置日志文件名和路径,默认值为/var/log/vsftpd.log。)

13、xferlog_std_format=YES
(注意:使用标准的日志格式。如果启用,则日志文件将会写成xferlog的标准格式,如同wu-ftpd 一般。默认值为yes。)

14、#idle_session_timeout=600
(注意:用户会话空闲后10分钟。设置多长时间不对FTP服务器进行任何操作,则断开该FTP连接,单位为秒。默认值为600。)

15、#data_connection_timeout=120
(注意:将数据连接空闲2分钟断开。设置建立FTP数据连接的超时时间,单位为秒。默认值为120。)

16、#nopriv_user=ftpsecure
(注意:为FTP服务器指定一个完全孤立和无特权的用户,即在系统服务中指定一个独特的用户。即指定一个用户,当VSFTPD不想要什么权限时,使用此用户身份。这用户最好是一个专用的用户,而不是用户nobody。在大多数的机器上,nobody用户被用于大量重要的事情。默认值为nobody。)

17、#async_abor_enable=YES
(注意:启用时,一个特殊的FTP命令\"async ABOR”将容许使用,一般不用,容易出现问题。只有不正常的FTP客户端要使用这一点。而且,这个功能又难于操作,所以,默认是把它关闭了。但是,有些客户端在取消一个传送的时候会被挂死(估计是客户端无响应),那你只有启用这个功能才能避免这种情况。 默认值:yes)

18、#ascii_upload_enable=YES
(注意:启用上传的ASCII传输方式。设置是否启用ASCII 模式上传数据。默认值为yes。)

19、#ascii_download_enable=YES
(注意:启用下载的ASCII传输方式,设置是否启用ASCII 模式下载数据。默认值为yes。)

20、#ftpd_banner=Welcome to blah FTP service.
(注意:欢迎信息。这里用来定义欢迎话语的字符串,banner_file是档案的形式,而ftpd_banner 则是字符串的形式。)

21、#deny_email_enable=YES
(注意;是否允许禁止匿名用户使用某些邮件地址,这有助于防止dos攻击。.若是启动这项功能,则必须提供一文件夹/etc/vsftpd/banner_emails,内容为email address。若是使用匿名登入,则会要求输入email address,若输入的email address 在此档案内,则不允许进入。默认值为yes。)

22、 #banned_email_file=/etc/vsftpd.banned_emails
(注意:此文件用来输入email address,只有在deny_email_enable=YES时,才会使用到这个文件夹。若是使用匿名登陆,则会要求输入email address,若输入的email address 在此档案内,则不允许进入。)

23、#chroot_list_enable=YES
(注意:设置是否启用chroot_list_file配置项指定的用户列表文件。如果启动这项功能,则所有列在chroot_list_file之中的使用者不能更改根目录 .默认值为yes。)

通过与chroot_local_user=YES/NO搭配能实现以下几种效果:
1、当chroot_list_enable=YES,chroot_local_user=YES时,在/etc/vsftpd.chroot_list文件中列出的用户,可以切换到其他目录;未在文件中列出的用户,不能切换到其他目录。
2、当chroot_list_enable=YES,chroot_local_user=NO时,在/etc/vsftpd.chroot_list文件中列出的用户,不能切换到其他目录;未在文件中列出的用户,可以切换到其他目录。
3、当chroot_list_enable=NO,chroot_local_user=YES时,所有的用户均不能切换到其他目录。
4、当chroot_list_enable=NO,chroot_local_user=NO时,所有的用户均可以切换到其他目录。
24、#chroot_list_file=/etc/vsftpd.chroot_list
(注意:指出被锁定在自家目录中的用户的列表文件。文件格式为一行一用户。通常该文件是/etc/vsftpd/chroot_list。此选项默认不设置。)

25、#ls_recurse_enable=YES
(注意:若是启用此功能,则允许登入者使用ls –R(可以查看当前目录下子目录中的文件)这个指令。默认值为yes。)

26、pam_service_name=vsftpd
(注意:设置PAM使用的名称,默认值为/etc/pam.d/vsftpd。这里只制定文件名)

27、userlist_enable=YES
(注意:是否启用vsftpd.user_list文件,这个语句参数和‘userlist_deny=yes/no’配合控制vsftpd.user_list文件中的用户是否能访问vsftp服务。当userlist_enable=yes;userlist_deny=yes时则禁止vsftpd.user_list文件中的用户登录vsfpd服务。当userlist_enable=yes;userlist_deny=no时只允许vsftpd.user_list文件中记录的ftp用户能登录vsftp服务)

28、listen=YES
(注意:设置vsftpd服务器是否以standalone模式运行。以standalone模式运行是一种较好 的方式,此时listen必须设置为YES,此为默认值。建议不要更改,有很多与服务器运行相关的配置命令,需要在此模式下才有效。若设置为NO,则 vsftpd不是以独立的服务运行,要受到xinetd服务的管控,功能上会受到限制。)

29、tcp_wrappers=YES
(注意:设置vsftpd是否与tcp wrapper相结合来进行主机的访问控制。默认值为YES。如果启用,则vsftpd服务器会检查/etc/hosts.allow 和/etc/hosts.deny 中的设置,来决定请求连接的主机,是否允许访问该FTP服务器。这两个文件可以起到简易的防火墙功能。

比如:若要仅允许192.168.10.1—192.168.10.254的用户可以连接FTP服务器,则在/etc/hosts.allow文件中添加以下内容:
vsftpd:192.168.10. :allow
all:all :deny)

vsftpd配置文件详解(默认版).pdf下载

—————————————————————————————————
特别声明:--
一、本文为原创,著作权及使用权为(作者笔名:闪电cto)本人所有。 ­
二、本文首发于51cto个人博客(http://xudeqiang.blog.51cto.com)。 ­
三、本文只供互联网上的读者分享,不供共享范畴,希知。 ­
四、未经许可严禁对本文作修改、节选、断章性质的处理。 ­
五、可转载,但必须注明原文章首发的出处网址,及文章作者,严禁复制。 ­
六、如若转摘用于杂志网络媒体新闻,必须通知作者得到允许后方可,需收稿费。­
七、作者联系信息:QQ:306718122 邮箱levinboy@foxmail.com
——————————————————————————————

附件:http://down.51cto.com/data/2353379
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息