ProFTP配置一例

# 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   "XXX.COM"
ServerType   standalone
DefaultServer   on

DisplayLogin /www/bin/proftp/etc/msg.txt   #欢迎词文件
WtmpLog off

ServerIdent off
TimesGMT off
RequireValidShell   off    #设置如果shell为空时允许用户登录

MaxLoginAttempts 3
TimeoutIdle   120      #-- 设置空闲连接超时时钟
TimeoutLogin   120      #-- 设置空闲登陆超时时钟
TimeoutNoTransfer  120      # -- 设置当没有数据传输时的超时时钟
TimeoutStalled  30         #-- 设置被阻塞的下载的超时时钟

MaxClients 300      #最多允许300个用户在线
MaxClientsPerHost 1  "    对不起,一个IP同一时间只允许一个连接"
MaxHostsPerUser 1 "    对不起,每个帐户最多允许来源ip为1个"
MaxClientsPerUser 1 "    对不起,每个帐户在每个客户端最多可以同时登陆1次"

#允许断点续传(上传),断点续续(下载)是默认支持的,不用设置
AllowStoreRestart on

SQLAuthTypes Backend Plaintext
#Backend表示用户认证方式为MySQL数据库的认证方式
#Plaintext表示明文认证方式,排在最前面的为最先使用的方式
SQLAuthenticate users* groups*

# databasename@host database_user user_password
SQLConnectInfo proftpd@localhost proftp_user proftp_pwd
SQLUserInfo ftpuser userid passwd uid gid homedir shell
SQLGroupInfo ftpgroup groupname gid members
#如果用户主目录不存在,则系统会根据此用户在用户数据表中的homedir字段的值新建一个目录
SQLHomedirOnDemand off
# Update count every time user logs in
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1,accessed=now() WHERE userid='%u'" ftpuser

# Update modified everytime user uploads or deletes a file
SQLLog STOR,DELE modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser

# 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   300

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

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

# Normally, we want files to be overwriteable.
<DIRECTORY />
  AllowOverwrite  off
</DIRECTORY>
<LIMIT READ RETR>#允许下载
AllowAll
</LIMIT>

<LIMIT CMD MKD RNFR DELE RMD STOR WRITE DIRS>#不允许其它权限 
DenyAll
</LIMIT>

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注