目前,我们在ProFTPd服务器的全局范围内定义了以下几行:
# Allow max 3 unauthenticated connections by IP MaxConnectionsPerHost 3 "Sorry, you may not connect more than (%m) times." # Allow max 3 authenticated connections by IP MaxClientsPerHost 3 "Sorry, the maximum number clients (%m) from your host are already connected." # Allow max 10 connection by user ###### MaxClientsPerUser 10 "Sorry, there is already (%m) other connection for this account."
它的工作原理如下,但是我们希望允许一些特定的(不是全部的)authentication的用户(或IP作为缺点)打开比上面指定的更多的连接。
这可能与ProFTPd?
是的 – >任何帮助,将不胜感激。
没有 – >是否有任何其他生产级免费FTP服务器像PureFTP或vsftpd也许,这符合这些要求?
是的,这是可能的,使用mod_ifsession
的<IfUser>
和<IfClass>
部分。
使用<IfUser>
部分,您可以定义用户特定的部分,如下所示:
<IfUser user1, user2, user3> # Special users get special treatment MaxConnectionsPerHost 30 MaxClientsPerHost 30 MaxClientsPerUser 100 <IfUser> <IfUser AND !user1, !user2, !user3> # All other users get the normal treatment MaxConnectionsPerHost 3 MaxClientsPerHost 3 MaxClientsPerUser 10 </IfUser>
如果您有许多用户,则还可以考虑使用组而不是单独的用户名,以及<IfGroup>
部分。
对于IP地址/范围的限制,我build议使用ProFTPD的类 。 使用类,以及<IfClass>
的<IfClass>
部分,您可以执行如下操作:
<Class special-ips> From 1.2.3.4 From abcd </Class <IfClass special-ips> # Clients from the special class get special treatment MaxConnectionsPerHost 30 MaxClientsPerHost 30 MaxClientsPerUser 100 </IfClass> <IfClass !special-ips> # All other clients get the normal treatment MaxConnectionsPerHost 3 MaxClientsPerHost 3 MaxClientsPerUser 10 </IfClass>
请注意,定义“匹配”规则和 “不匹配”规则是一个非常好的主意 。
ProFTPD Connection ACLS howto也涵盖了这个主题,并提到了其他模块( 例如 mod_wrap2
, mod_geoip
),这些模块也可以在这方面提供帮助。
希望这可以帮助!