LinuxSir.cn,穿越时空的Linuxsir!

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

proftpd 匿名用户问题

[复制链接]
发表于 2007-10-28 15:17:13 | 显示全部楼层 |阅读模式
在/etc/proftpd/proftpd.conf加上了日志功能,
#lftp://192.168.1.100后从日志中看到
Oct 19 18:06:44 gentoo proftpd[12441] 61.139.8.100 (192.168.1.100[192.168.1.100]): ftp: Directory /home/ftp/ is not accessible.
Oct 19 18:06:44 gentoo proftpd[12441] 61.139.8.100 (192.168.1.100[192.168.1.100]): Maximum login attempts (1) exceeded, connection refused
Oct 19 18:06:44 gentoo proftpd[12441] 61.139.8.100 (192.168.1.100[192.168.1.100]): FTP session closed
提示/home/ftp目录不能访问,但也不是权限问题,因为/home/fans已被我改为了
nobody:nobody,可读可写,怎么回事哦?有遇到过类似情况的吗?
我的/etc/proftpd/proftpd.conf
#proftpd.conf
# Linux@SMTH.org
# by windtear@ipcn.org
# 2002-10-29 11:41
#
<Global>                        #global也可不要,后面如设置多个虚拟站点清晰
IdentLookups            off     #连接快些 还有后面的 UseReverseDNS
RequireValidShell       off     #匿名的一般需要加上这个
RootLogin off
MaxLoginAttempts        1       #匿名的话1就可以了,最大密码验证次数
WtmpLog NONE                    #不记log到wtmp
DenyFilter \*.*/|.ftpaccess     #DenyFilter做一些过滤,正则表达式
#DenyFilter ~!`\**/?,$@         # 根据自己需要写吧,上面的好烂
#LsDefaultOptions       "-l"    #ls参数
#AllowForeignAddress    on      #要允许 FXP 写成 on
CommandBufferSize 128           #最大命令长度
DirFakeUser On FTP              #不显示给用户真实的用户、组
DirFakeGroup On FTP
DeferWelcome            on      #显示欢迎信息
PathDenyFilter  "(^\.ftpaccess$)"       #同DenyFilter 过滤用
User                    nobody          #proftpd 以哪个用户、组的身份运行
Group                   nobody
TimesGMT off                            #时间

<Limit LOGIN DELE RMD XRMD SITE RNFR RNTO WRITE>
DenyAll
</Limit>        #出于某些考虑,开始禁掉,后面需要再打开。READ也可加过来...
                #也可以这里设置允许连接的网段 Login,或者后面,建议用防火墙
        <Limit ALL>
        IgnoreHidden on
        </Limit>

        <Directory /*>
        HideNoAccess on
        AllowOverwrite          off     #禁止重写覆盖,后面打开允许续传
        </Directory>                    #AllowRetrieveRestart默认是on 也可以写进来
        </Global>

        ServerName      "FTP server"
        ServerType      standalone      #运行方式 还可以用 inetd xinetd
        ServerIdent on "Welcome to FTP" #身份验证前显示给用户的,也可用文件,这里略
        DefaultServer   on
        UseReverseDNS   off     #加快连接速度
        Port            21      #FTP端口
        Umask           022     #掩码 为了便于管理 用 002
        PassivePorts    20000   30000           #被动模式端口段

        SystemLog /var/proftpd/syslog   #log 注意自己加上 logrotate 配置

        MaxInstances            250             #最大
        TimeoutLogin            30              #身份验证超时
        TimeoutIdle             120             #发呆超时
        TimeoutNoTransfer       300             #无数据传输超时
        #TimeoutStalled         300

        #log一些自定义格式,根据需要调整或者用默认
        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"
        #匿名的根目录 记得设置相应目录权限,ftp 用户应至少有 r x 权限
<Anonymous /home/ftp>
          User                          ftp
            Group                       ftp
              Umask                         002
                UserAlias                     anonymous ftp

        MaxClients 10 "客满(%m)"      #人多时的提示信息,可以用一些变量
            #RateReadBPS 500000           #限速用
              MaxClientsPerHost 2 "连接数多"        #一个IP的连接数
                TransferLog NONE              #log
          ExtendedLog /var/proftpd/upload.log write myxfer      #log
            ExtendedLog /var/proftpd/download.log read myxfer     #log

              DisplayLogin          etc/welcome             #欢迎文件,可以用一些变量
                DisplayChdir     .message                #改变目录时显示的消息

        AuthAliasOnly on       #只允许 UserAlias 过的 这里只允许 anonymous 不允许ftp
        <Limit LOGIN>
        AllowAll
        </Limit>                #打开允许连接,可以这是允许访问的网段,建议防火墙

        <directory /home/ftp>
                <limit WRITE>
                        denyall
                </limit>
                <limit READ DIRS>
                        allowall
                </limit>
        </directory>
        <Directory incoming>
          AllowStoreRestart on  #允许上传目录,可以续传,不能覆盖
            <Limit WRITE>
                AllowAll
          </Limit>              #如果不想让下载,只让上载 可以加上
                                  #<Limit READ>DenyAll</Limit>
          </Directory>            #到这差不多就完了,每个目录可以写 .ftpaccess 设置权限
                                  #后面这两个可以参考根据需要

          #在FTP根目录又不让看的,上面把欢迎信息放里面了,当然可以放别的
#          <Directory etc>
#            <Limit READ WRITE DIRS>
#                DenyAll
#          </Limit>
#          </Directory>
#          <Directory me>    #限制特定IP段能看的,也可在目录的.ftpaccess里面设置
#            <Limit ALL>
#                Order deny,allow
#            Allow from 192.168.
#              </Limit>
#              </Directory>
</Anonymous>            #到这匿名的就完了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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