LinuxSir.cn,穿越时空的Linuxsir!

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

proftpd的各用户如何限制ip的访问

[复制链接]
发表于 2004-10-14 10:06:51 | 显示全部楼层 |阅读模式
debian woody+proftpd
用户1:所有ip均可访问
用户2:仅限192.168.*.*,202.200.*.*访问。
请问如何实现?
发表于 2004-10-14 13:57:07 | 显示全部楼层
<Limit LOGIN>
Order allow,deny
Deny from ip1/mask2
Deny from ip2/mask2
Deny from all
</Limit>
 楼主| 发表于 2004-10-15 16:06:26 | 显示全部楼层
最初由 faint 发表
<Limit LOGIN>
Order allow,deny
Deny from ip1/mask2
Deny from ip2/mask2
Deny from all
</Limit>



有点问题吧?
应该是这样吧?
<Limit LOGIN>
Order allow,deny
Allow from all
Deny from ip1/mask2
Deny from ip2/mask2
</Limit>

如果要实现我要求的那个功能应该是这样吧:
<Directory /home/usr1>
<Limit LOGIN>
Order allow,deny
Allow from all
</Limit>
</Directory>

<Directory /home/usr2>
<Limit LOGIN>
Order allow,deny
Allow from all
Deny from ip1/mask2
Deny from ip2/mask2
</Limit>
</Directory>
 楼主| 发表于 2004-11-2 14:08:12 | 显示全部楼层

  1. # This is a basic ProFTPD configuration file (rename it to
  2. # 'proftpd.conf' for actual use.  It establishes a single server
  3. # and a single anonymous login.  It assumes that you have a user/group
  4. # "nobody" and "ftp" for normal operation and anon.

  5. ServerName                      "Bupticet's FTP server,powered by Proftpd on Debian linux"
  6. ServerIdent                     On "Bupticet's FTP server,powered by Proftpd on Debian linux"
  7. ServerType                      standalone
  8. DeferWelcome                    off
  9. #ServerIdent                    Off

  10. ShowSymlinks                    on
  11. MultilineRFC2228                on
  12. DefaultServer                   on
  13. ShowSymlinks                    on
  14. AllowOverwrite                  on
  15. RequireValidShell               off
  16. AllowForeignAddress             on
  17. #PassivePorts           20000 30000

  18. TimeoutNoTransfer               600
  19. TimeoutStalled                  600
  20. TimeoutIdle                     120

  21. MaxInstances                    250
  22. DisplayLogin                    welcome.msg
  23. DisplayFirstChdir               .message
  24. LsDefaultOptions                "-l"

  25. DenyFilter                      \*.*/

  26. # Uncomment this if you are using NIS or LDAP to retrieve passwords:
  27. #PersistentPasswd               off

  28. # Port 21 is the standard FTP port.
  29. Port                            21

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

  38. # Set the user and group that the server normally runs at.
  39. User                            nobody
  40. Group                           nogroup
  41. DefaultRoot ~
  42. # Normally, we want files to be overwriteable.

  43. <Directory "/home/silver/*">
  44. <Limit LOGIN>
  45. Order deny,allow
  46. Allow from 0.0.0.0/0.0.0.0
  47. </Limit>
  48. </Directory>

  49. <Directory "/home/resin/*">
  50. <Limit LOGIN>
  51. Order deny,allow
  52. Deny from 0.0.0.0/0.0.0.0
  53. Allow from 202.204.15.0/255.255.255.0
  54. Allow from 202.204.14.0/255.255.255.0
  55. Allow from 192.168.199.0/255.255.255.0
  56. Allow from 192.168.200.0/255.255.255.0
  57. </Limit>
  58. </Directory>

  59. <Directory /*>
  60.   Umask                         022  022
  61.   AllowOverwrite                on
  62. </Directory>

  63. # A basic anonymous configuration, no upload directories.

  64. ## <Anonymous ~ftp>
  65. ##   User                               ftp
  66. ##   Group                              nogroup
  67. ##   # We want clients to be able to login with "anonymous" as well as "ftp"
  68. ##   UserAlias                  anonymous ftp
  69. ##
  70. ##   RequireValidShell          off
  71. ##
  72. ##   # Limit the maximum number of anonymous logins
  73. ##   MaxClients                 10
  74. ##
  75. ##   # We want 'welcome.msg' displayed at login, and '.message' displayed
  76. ##   # in each newly chdired directory.
  77. ##   DisplayLogin                       welcome.msg
  78. ##   DisplayFirstChdir          .message
  79. ##
  80. ##   # Limit WRITE everywhere in the anonymous chroot
  81. ##   <Directory *>
  82. ##     <Limit WRITE>
  83. ##       DenyAll
  84. ##     </Limit>
  85. ##   </Directory>
  86. ##
  87. ##   # Uncomment this if you're brave.
  88. ##   # <Directory incoming>
  89. ##   #   # Umask 022 is a good standard umask to prevent new files and dirs
  90. ##   #   # (second parm) from being group and world writable.
  91. ##   #   Umask                          022  022
  92. ##   #            <Limit READ WRITE>
  93. ##   #            DenyAll
  94. ##   #            </Limit>
  95. ##   #            <Limit STOR>
  96. ##   #            AllowAll
  97. ##   #            </Limit>
  98. ##   # </Directory>
  99. ##
  100. ## </Anonymous>

复制代码


以上是我的配置文件,但还是不能限制ip范围,那两段配置好像根本不起作用。。。
 楼主| 发表于 2004-11-2 14:22:35 | 显示全部楼层
改成这样也还是不行:
<Directory "/home/silver/*">
<Limit LOGIN>
Order allow,deny
Allow from 0.0.0.0/0.0.0.0
</Limit>
</Directory>

<Directory "/home/resin/*">
<Limit LOGIN>
Order allow,deny
Allow from 202.204.15.0/255.255.255.0
Allow from 202.204.14.0/255.255.255.0
Allow from 192.168.199.0/255.255.255.0
Allow from 192.168.200.0/255.255.255.0
Deny from 0.0.0.0/0.0.0.0
</Limit>
</Directory>
发表于 2004-11-2 20:33:10 | 显示全部楼层
Limits flow downward, so that a Limit configuration in the server config context applies to all <Directory> and <Anonymous> blocks that also reside in the configuration; until it is overridden by a "lower" <Limit> block.

是不是下面的那个Limit把上面的那个覆盖掉了?
 楼主| 发表于 2004-11-3 10:27:32 | 显示全部楼层
我觉得应该不是这个问题吧???
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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