답변:
settings.php 파일에 다음 코드를 추가하면됩니다.
$conf['user_failed_login_ip_limit'] = PHP_INT_MAX;
이런 식으로 IP가 차단되지 않습니다.
user_login_authenticate_validate () 에는 다음 코드가 포함되어 있습니다.
if (!empty($form_state['values']['name']) && !empty($password)) {
// Do not allow any login from the current user's IP if the limit has been
// reached. Default is 50 failed attempts allowed in one hour. This is
// independent of the per-user limit to catch attempts from one IP to log
// in to many different user accounts. We have a reasonably high limit
// since there may be only one apparent IP for all users at an institution.
if (!flood_is_allowed('failed_login_attempt_ip', variable_get('user_failed_login_ip_limit', 50), variable_get('user_failed_login_ip_window', 3600))) {
$form_state['flood_control_triggered'] = 'ip';
return;
}
$account = db_query("SELECT * FROM {users} WHERE name = :name AND status = 1", array(':name' => $form_state['values']['name']))->fetchObject();
if ($account) {
if (variable_get('user_failed_login_identifier_uid_only', FALSE)) {
// Register flood events based on the uid only, so they apply for any
// IP address. This is the most secure option.
$identifier = $account->uid;
}
else {
// The default identifier is a combination of uid and IP address. This
// is less secure but more resistant to denial-of-service attacks that
// could lock out all users with public user names.
$identifier = $account->uid . '-' . ip_address();
}
$form_state['flood_control_user_identifier'] = $identifier;
// Don't allow login if the limit for this user has been reached.
// Default is to allow 5 failed attempts every 6 hours.
if (!flood_is_allowed('failed_login_attempt_user', variable_get('user_failed_login_user_limit', 5), variable_get('user_failed_login_user_window', 21600), $identifier)) {
$form_state['flood_control_triggered'] = 'user';
return;
}
}
// We are not limited by flood control, so try to authenticate.
// Set $form_state['uid'] as a flag for user_login_final_validate().
$form_state['uid'] = user_authenticate($form_state['values']['name'], $password);
}
한계는 실제로 두 가지입니다. Drupal은 항상 IP를 가지고 있고 Drupal은 사용자 ID를 가지고있을 때 하나입니다. 후자는 사용자가 기존 계정의 사용자 이름을 입력 한 경우입니다. 이 경우 Drupal은 사용자 ID와 IP를 등록합니다.
이 경우도 피하려면이 행도 setting.php 파일에 추가해야합니다.
$conf['user_failed_login_user_limit'] = PHP_INT_MAX;
$conf['user_failed_login_user_window'] = 5;
PHP_INT_MAXPHP가 정수에 할당 할 수있는 최대 값입니다. 다른 값을 5로 설정했습니다. 제한이 유효한 시간 (초)이기 때문입니다. user_failed_login_user_limit를 10으로 설정하고 user_failed_login_user_window를 5로 설정하면 5 초 동안 10 회의 로그인 시도가 허용됨을 의미합니다. settings.php 파일 만 변경하면 IP / 사용자가 더 이상 차단되지 않습니다.
PHP_INT_MAX9223372036854775807입니다. 32 비트 시스템의 경우 해당 값은 2147483647입니다. 정확합니다. 5 초 동안의 시도 횟수입니다. 시도 횟수가 이보다 적 으면 IP / 사용자가 차단되지 않습니다.
에서 드루팔 8 , 당신은 설정 파일에 홍수 설정을 변경할 수 있습니다 user.flood.yml.
uid_only: false
ip_limit: 50
ip_window: 3600
user_limit: 5
user_window: 21600
_core:
default_config_hash: UYfMzeP1S8jKaaaavxf7nQNe8DsNS-3bc2WSNNXBQWs
이는 IP 및 사용자 당 제한이 있음을 의미합니다.
설정을 변경하고 가져올 수 있습니다 (5 분당 100 회 시도로 설정).
uid_only: false
ip_limit: 100
ip_window: 300
user_limit: 100
user_window: 300
_core:
default_config_hash: UYfMzeP1S8jKaaaavxf7nQNe8DsNS-3bc2WSNNXBQWs
$config['user.flood']['user_limit'] = 100;
settings.php? 무한한가PHP_INT_MAX? 무한 한도 (PHP_INT_MAX)도 설정할 수 있습니까user_failed_login_user_window?5거기에 설정되어 있기 때문입니다 .