AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 801637
Accepted
DevOps
DevOps
Asked: 2016-09-08 07:39:33 +0800 CST2016-09-08 07:39:33 +0800 CST 2016-09-08 07:39:33 +0800 CST

用户的 Proftpd 连接限制规则

  • 772

我们目前在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."

它像有人参与的那样工作,但我们希望允许一些特定的(不是全部)经过身份验证的用户(或作为缺点的 IP)打开比指定的上层更多的连接。

ProFTPd 有可能吗?

是的-> 任何帮助将不胜感激。

否 -> 是否有其他符合这些要求的生产级免费 FTP 服务器,例如 PureFTP 或 vsftpd?

proftpd
  • 1 1 个回答
  • 1912 Views

1 个回答

  • Voted
  1. Best Answer
    Castaglia
    2016-09-09T09:10:13+08:002016-09-09T09:10:13+08:00

    是的,这是可能的,使用mod_ifsession's<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 地址/范围的限制,我建议使用 ProFTPD 的classes。使用类和 中的<IfClass>部分mod_ifsession,您可以执行以下操作:

    <Class special-ips>
      From 1.2.3.4
      From a.b.c.d
    </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

    希望这可以帮助!

    • 1

相关问题

  • SFTP 服务器:最好使用 SSH 内部 sftp 子系统或 ProFTPD 插件?

  • LIST 上的 ProFTPd 超时

  • 无法删除或编辑 ProFTPD 服务器上的文件

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve