Proftpd connexion limitation rule by user

We are currently defining in the Global scope of our ProFTPd server the following lines:

# 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."

It works as attended but we would like to allow some specific (not all) authenticated users (or IPs as drawback), to open more connections than the ones specified upper.

Is that possible with ProFTPd ?

Yes -> any help would be appreciated.

No -> Is there any other Production grade free FTP server like PureFTP or vsftpd maybe, that fit these requirement ?

0
задан 7 September 2016 в 18:39
1 ответ

Да, это возможно, используя разделы mod_ifsession и .

] Используя раздел ,вы должны определить пользовательские разделы, например:

<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>

Если у вас много пользователей, вы также можете рассмотреть возможность использования групп , а не отдельных имен пользователей, и раздел .

Для ограничений по IP-адресу / диапазону я бы рекомендовал использовать классы ProFTPD. С помощью классов и раздела из 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>

Обратите внимание, что очень хорошая идея для определения оба правила «сопоставления» и правила «несоответствия».

Руководство по ACLS для подключения к ProFTPD также охватывает эту тему и упоминает другие модули ( например ] mod_wrap2 , mod_geoip ), которые также могут помочь в этой области.

Надеюсь, это поможет!

1
ответ дан 4 December 2019 в 16:30

Теги

Похожие вопросы