LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 590|回复: 0

ProFTP配置文档

[复制链接]
发表于 2003-6-16 10:20:38 | 显示全部楼层 |阅读模式
经过几天的郁闷,在eTong和pupilzeng及其它网友的帮助才把RPOFTPD配置完成,把我的配置文档发出来加以说明,希望能其它有网友有所帮助。
如果下的的配置文档哪个地方有错误请各位网友提出并指正,
下面有些配置文档我没有说明(不知道怎么解释,请各位了解的老兄帮着添加上,谢谢,可以会出现笔误请大家见谅!)

# 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.
<Global>
UseReverseDNS                   off                #禁止使用DNS反向解析
IdentLookups                        off                #
CommandBufferSize             128                #最大命令长度
DirFakeUser                     On FTP              #不显示给用户真实的用户、组
DirFakeGroup                    On FTP                    #
MaxLoginAttempts                1                  #最大密友的验证次数
  
#<limit LOGIN DELE RMD XRMD SITE RNFR RNTO WRITE READ>
#  DenyAll                                                   #禁止以上所列出的命令动作
#</limit>


<limit All >
  IgnoreHidden                  on                 #
</limit>

<directory /*>
  HideNoAccess                  off                #
  AllowOverWrite                off                   #是否允许覆盖重写
</directory>
#
ServerName                        "My FTP Server "   #FTP服务器名称
ServerType                        standalone         #服务器的运行方式(还有INITD运行方式)
DefaultServer                        on

# Port 21 is the standard FTP port.
Port                                21                 #FTP服务所昨监听端口

# 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                   #设置的是proftpd产生的子进程的个数

TimeoutLogin                    30                 #登陆超时时间
TimeoutIdle                     120                #发呆超时
TimeoutNoTransfer               90                 #无数据传输的超时时间


# Set the user and group under which the server will run.
User                                nobody             #设置运行FTP的用户
Group                                nobody             #设置运行FTP的组(启动时以什么用户或组身份运行该程序)   

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
#  DefaultRoot ~                                   #将用户限定在自己的主目录下(只能在主目录及下级目录进行操作)
#  DefaultRoot /public/web                         #将用户限定在某一目录(只能在该录及下级目录进行操作)
  MaxClients                    10                 #最大可以有多少个客户端进行连接
# RateReadBPS                   1024000            #限制下载速度
# RateWriteBPS                  1024000            #限制上传速度
  MaxHostPerUser                10                 #设置最大用户的连接数
  MaxClientsPerHost             2                  #限制每个IP只能2个连接
  MaxClientsPeruser             5                  #限制每个同一个用户可以同时有5连接

  DisplayLogin                  ./welcome.msg      #用户登陆服务器时所显示的信息
  DisplayFirstChdir             ./message.msg      #用户在改变目录时所显示的信息
# AllowForeignAddress           on                   #允许外来的IP地址进行访问
# AllowOverwrite                on                    #设置可覆盖重写               
# AllowStoreRestart             on                   #设置可续传
   

  LogFormat myxfer              "%h %u %t \"%r\" %s %b"         
  LogFormat default             "%h %a %u %t \"%r\" %s %b $$ \'%F\'"
  LogFormat auth                "%h %a %t \"%r\" %s"
  LogFormat write               "%h %a %t \"%r\" %s %b"
                                                   #以上定义log文件的格式
  Systemlog                           /usr/local/proftp/etc/syslog.log #定义系统日志文件
  TransferLog                   /usr/local/proftp/etc/trans.log  #定义文件传输时的log文件存储位置
</Global>

#RootLogin                      off                #设置禁止用户Root登陆
-
#-----------------------------------------------------------
# Normally, we want files to be overwriteable.
<Anonymous  /public>                               #设定用户登陆时所进入的目录
   User                         ftp                #设定哪那些用户或组在登陆时直接进入该目录(上面所设定的目录)
   Group                        ftp                 #用户名和组名可以自定义
   AccessGrantMsg               "%U用户登陆成功"           #用户登陆成功信息
   AnonRequirePassword          on                   #启用访问口令
   AllowOverwrite                on                 #允许在该目录覆盖重定
   AllowStoreRestart            on                      #允许上传,支持续传,但不能覆盖
#  TransferRate APPE,RETR,STOR,STOU 1000           #表示传输速度始终是1000
                                                   
   <limit LOGIN>
     AllowUser                  lanmaster          #设置允许登陆的用户(在上面已经做过限制,所以要打开)
   </limit>
   
   <limit WRITE>
     Allow lanmaster                               #设置哪个用户对该目录有写的权限
    #AllowAll                                      #允许所有用户对该目录有定的权限
   </limit>

   <limit READ>                                    
     AllowAll                                           #允许所有用户对该目录有读的权限
   </limit>
  Umask 022                                        #该目录的权限掩码
#  LsDefaultOption              "-l"                   #ls命令时的默认参数
</Anonymous>


#--------------------------------------------------------------------------------------
#Anonymous Accessing

# A basic anonymous configuration, no upload directories.  If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
  <Anonymous /tmp>                                    #设置匿名访问的目录
   User                                Nobody             #设置匿名访问的用户、组
   Group                        Nobody             #原来默认为ftp                 
   RequireValidShell              off              #
# We want clients to be able to login with "anonymous" as well as "ftp"
   UserAlias                        Anonymous Nobody   #设置匿名访问用户的别名(ftp原设置)      
   AuthAliasOnly                on                 #只允许使用UserAlias定义过的别名,这里是Anonymous
#  TransferRate APPE,RETR,STOR,STOU 500:500        #表示当传输速度500时,将其限制在500

# Limit the maximum number of anonymous logins
#  MaxClients                        10                 #同时只允许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
   <Directory incoming/>                           #定义匿名用户上传目录
     <Limit STOR CWD>                              #
        AllowAll                                    #设置匿名用户对上传目录可写
     </Limit>                                      #  
     <Limit READ RMD DELE MKD>                     #
        DenyAll                                           #设置匿名用户对上传目录不可读、移动、册除、建立目录
     </Limit>                                      #
    </Directory>

   <Limit WRITE>
     DenyAll                                       #设置匿名用户没有写权限
   </Limit>
   <Limit READ>
     AllowAll                                      #设置匿名用户只有读取权限
   </Limit>
  </Anonymous>


:p :p
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表