LPIC-2 System Security Practice Question
A web server running Apache is receiving many failed login attempts. Which tool should be used to dynamically block IPs after a configurable number of failures?
⚠ Common exam trap
Test-takers frequently confuse static access control tools (TCP Wrappers, /etc/hosts.deny) or raw firewall commands (iptables) with a dynamic, log-monitoring intrusion prevention tool like fail2ban, which is specifically designed for this use case.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
fail2ban
fail2ban is the correct tool because it monitors log files (e.g., /var/log/apache2/error.log) for repeated failed login attempts and dynamically updates iptables or nftables rules to block the offending IP address after a configurable threshold (e.g., maxretry = 5). It is purpose-built for this task, offering flexible jails and ban actions, unlike static or system-wide mechanisms.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
fail2ban
Why this is correct
Monitors logs and dynamically bans IPs via firewall rules.
- ✗
TCP Wrappers
Why it's wrong here
Static access control based on hosts.allow and hosts.deny.
- ✗
/etc/hosts.deny
Why it's wrong here
Static, not dynamic.
- ✗
iptables
Why it's wrong here
Can block IPs but requires manual intervention or scripting for dynamic bans.
Go deeper
Related to this question
About these practice questions
One of 507 original LPIC-2 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-2 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-2 exam.