proftpd配置文件

#
# For more informations about Proftpd configuration
# look at : http://www.proftpd.org/
#
# This is a basic ProFTPD configuration file (rename it to
# ‘proftpd.conf’ for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# “nobody” and “ftp” for normal operation and anon.

ServerName            “ProFTPD”
ServerType            standalone
DefaultServer            on
ScoreboardFile        /var/run/proftpd.scoreboard

# Port 21 is the standard FTP port.
Port                21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances            30

MaxLoginAttempts 30
TimeoutLogin 120
TimeoutIdle 600
TimeoutNoTransfer 900
TimeoutStalled 3600

#允许最大的同时连接用户数
MaxClients 100

#允许每个用户主机最大并发连接数
MaxClientsPerHost 30

RequireValidShell off

#将用户限制在自己的主目录下 ,这个设置很重要
DefaultRoot ~

#设置系统最大的进程数,防止dos攻击,默认是30
MaxInstances 10

CommandBufferSize    512

# Set the user and group under which the server will run.
User                FTPUSR
Group                FTPGRP

# To cause every FTP user to be “jailed” (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~

# Normally, we want files to be overwriteable.
AllowOverwrite        on
AllowStoreRestart on
AllowForeignAddress on
UseReverseDNS off

#设置对全局的文件可以进行改写
<Directory />
AllowOverwrite on
</Directory>

# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit>

UseReverseDNS off
IdentLookups off

# A basic anonymous configuration, no upload directories.  If you do not
# want anonymous users, simply delete this entire <Anonymous> section.

#########################################################################
#                                                                       #
# Uncomment lines with only one # to allow basic anonymous access       #
#                                                                       #
#########################################################################

#<Anonymous ~ftp>
#   User                ftp
#   Group                ftp

### We want clients to be able to login with “anonymous” as well as “ftp”
# UserAlias            anonymous ftp

### Limit the maximum number of anonymous logins
# MaxClients            10

### We want ‘welcome.msg’ displayed at login, and ‘.message’ displayed
### in each newly chdired directory.
# DisplayLogin            welcome.msg
# DisplayFirstChdir        .message

### Limit WRITE everywhere in the anonymous chroot
# <Limit WRITE>
#   DenyAll
# </Limit>
#</Anonymous>

####################### MySQL数据库部分设置 ###########
#数据库联接的信息
#FTP是数据库名,localhost是MySQL主机名,3306是mysql服务的端口号
#Michael是连接数据库的用户名,testpwd是密码(如果没有密码留空)
SQLConnectInfo proftp@localhost:3306 username password

#数据库认证的类型
SQLAuthTypes Backend Plaintext

#指定用来做用户认证的表的有关信息。(将在后面创建)
SQLUserInfo FTPUSERS userid passwd uid gid homedir shell
SQLGroupInfo FTPGRPS groupname gid members

#数据库认证
SQLAuthenticate users groups usersetfast groupsetfast

#proftpd进行的mysql调用语句,别修改任何地方

SQLNamedQuery get-quota-limit SELECT “name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail,files_in_avail, files_out_avail, files_xfer_avail FROM quotalimits WHERE name = ‘%{0}’ AND quota_type = ‘%{1}'”

SQLNamedQuery get-quota-tally SELECT “name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM quotatallies WHERE name = ‘%{0}’ AND quota_type = ‘%{1}'”

SQLNamedQuery update-quota-tally UPDATE “bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = ‘%{6}’ AND quota_type = ‘%{7}'” quotatallies

SQLNamedQuery insert-quota-tally INSERT “%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}” quotatallies