vsftp的配置

仅供存放个人的配置文件,不要在本版发问。
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

vsftp的配置

#1

帖子 oneleaf » 2006-09-06 8:46

$ cat /etc/vsftpd.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=YES
#
# Run standalone with IPv6?
# Like the listen parameter, except vsftpd will listen on an IPv6 socket
# instead of an IPv4 one. This parameter and the listen parameter are mutually
# exclusive.
#listen_ipv6=YES
#
# 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.
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
#
# 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 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().
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
#
#
# Debian customization
#
# Some of vsftpd's settings don't fit the Debian filesystem layout by
# default.  These settings are more Debian-friendly.
#
# 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
#
# 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/vsftpd.pem

$ cat /etc/vsftpd.chroot_list

代码: 全选

administrator


ftp访问,允许普通帐号使用ftp,并限制在用户主目录,帐号administrator不限制在当前目录。
XinYi.F
帖子: 32
注册时间: 2006-11-19 11:36
来自: Yingkou.LN.china
联系:

#2

帖子 XinYi.F » 2006-12-12 1:13

listen=YES
#listen_ipv6=YES
anonymous_enable=YES 允许匿名登入
#local_enable=YES 允许本地用户登入
#write_enable=YES 允许本地用户修改和删除
#local_umask=022 FTP上传文件权限 ,默认是077
#anon_upload_enable=YES 允许匿名用户上传
#anon_mkdir_write_enable=YES 允许匿名用户的写和创建目录的权限
dirmessage_enable=YES 当切换目录时,显示该目录下message隐藏文件的内容
xferlog_enable=YES 激活上传和下载的日志
connect_from_port_20=YES 启动FTP数据端口的连接请求
#chown_uploads=YES
#chown_username=whoever 改变上传文件的所有着为whoever
#xferlog_file=/var/log/vsftpd.log 上传/下载日志文件所默认的路径
#xferlog_std_format=YES 使用标准的ftpd xferlog日志格式
#idle_session_timeout=600 将在用户会话空闲10分钟后被中断
#data_connection_timeout=120 将在数据连接空闲2分钟后被中断
#nopriv_user=ftpsecure 运行vsftpd需要的非特殊系统用户默认nobody
#async_abor_enable=YES 是否允许运行特殊的FTP命令async
#ascii_upload_enable=YES 启用上传的ascii传输方式
#ascii_download_enable=YES 启用下载的ascii传输方式
#ftpd_banner=Welcome to blah FTP service. 用户连接服务器后显示信息

#deny_email_enable=YES 是否允许某些匿名用户使用邮件地址(默认的)
#banned_email_file=/etc/vsftpd.banned_emails如果是输入禁止的邮件地址的路径和名
==============================
#chroot_local_user=YES
#chroot_list_file=/etc/vsftpd.chroot_list
在 默认配置中,本地用户可以切换到自家目录以外的目录进行浏览,并在权限许可的范围内进行下载和上传。这样的设置对于一个FTP服务器来说是不安全的。如果希望用户登录后不能切换到自家目录以外的目录,则需要设置chroot选项,涉及如下选项:
chroot_local_user
chroot_list_enable
chroot_list_file

有两种设置chroot的方法:
(1)设置对所有的本地用户执行chroot(即活动范围限制在自家目录)只要将chroot_local_user的值设 为YES即可, 即:

chroot_local_user=YES

(2)设置指定的用户执行chroot需要如下的设置:

chroot_local_user=NO
chroot_list_enable=YES (默认的)
chroot_list_file= /etc/vsftpd.chroot_list

这样,只有/etc/vsftpd.chroot_list文件中指定的用户才执行chroot。
注意 :上面所提及的文件/etc/vsftpd.chroot_list和下面将要提及的文件 /etc/vsftpd.user_list的格式要求均为每个 用户名占一行。

#ls_recurse_enable=YES 是否使用ls-R命令已防止浪费大量的服务器资源

secure_chroot_dir=/var/run/vsftpd
#这个选项必须指定一个空的数据夹且任何登入者都不能有写入的权限,当vsftpd 不需要file system 的权限时,就会将使用者限制在此数据夹中。默认值为/var/run/vsftpd

pam_service_name=vsftpd #定义PAM 所使用的名称,预设为vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem vsftpd用的rsa证书的位置

rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key 算法钥匙地址!
==================================
CPU : k8 amd3000+
主板: 梅捷amn55-GR
硬盘: ST160g
内存: 黑金刚 512m
显卡: 翔升7300LE 128bit
光驱: 爱国者52*cd刻入机箱: 多彩38度
OS: Windows XP Sp2/ubuntu 6.06 LTS
头像
raulvii
帖子: 90
注册时间: 2006-10-21 17:06

#3

帖子 raulvii » 2007-05-13 14:37

收藏下先!谢谢;了的!
wangjc5210
帖子: 4
注册时间: 2007-08-27 14:47

#4

帖子 wangjc5210 » 2007-08-29 20:43

呵呵 不错~~~~~
xdhpc
帖子: 6
注册时间: 2007-06-14 16:16

#5

帖子 xdhpc » 2007-09-25 8:07

有没有像windows下Serv-u这样设置简单的FTP服务器程序呢?总感觉vsFTP配置有点复杂啊
头像
chinafenghao
帖子: 234
注册时间: 2007-12-18 21:50

#6

帖子 chinafenghao » 2007-12-29 21:08

收藏。!!
lyhic
帖子: 112
注册时间: 2007-06-29 20:19

#7

帖子 lyhic » 2007-12-30 16:21

好好学习,天天向上!
sop566
帖子: 1
注册时间: 2007-12-29 16:42

#8

帖子 sop566 » 2007-12-30 16:34

收藏起来了
头像
守望桑田
帖子: 86
注册时间: 2007-04-19 7:33
来自: Xiamen
联系:

#9

帖子 守望桑田 » 2008-02-22 19:13

thanks
人生的意义在于坚持不懈的折腾!
Weibo:http://weibo.com/Yousri
Blog:http://blog.yousri.org
Twitter:http://twitter.com/Yousri
0910
帖子: 78
注册时间: 2006-07-28 20:21
联系:

#10

帖子 0910 » 2008-03-18 10:33

看了,呵呵,有用了
xmffxm
帖子: 8
注册时间: 2008-03-10 22:28

#11

帖子 xmffxm » 2008-04-09 23:40

明天好好学习学习,现在是睡觉的时间了 :D :D
kevinduan
帖子: 15
注册时间: 2008-03-14 10:46

#12

帖子 kevinduan » 2008-06-12 16:26

这几天正好在弄VFTPD,学习了。谢谢!
头像
Jarson
帖子: 2371
注册时间: 2008-07-21 9:44
来自: 深圳
联系:

#13

帖子 Jarson » 2008-08-31 11:40

学习了
bugle
帖子: 94
注册时间: 2009-09-22 21:26

Re: vsftp的配置

#14

帖子 bugle » 2009-10-06 19:13

想问一下,这个文件在哪里有啊?我在/etc 的目录下没找到啊,是要自己新建的吗?
头像
simple.lin
帖子: 14
注册时间: 2009-12-31 23:11

Re: vsftp的配置

#15

帖子 simple.lin » 2010-01-11 11:15

收下 :em06
今天份外,明天份内
回复