Skip to content
  • About
  • Contact
  • Docs
  • Features
  • Home

Configurations

5
  • Setup RAID Level 6
  • Setup RAID Level 5
  • How To Add Swap on RHEL or Centos based system
  • Website Migration to Non-Panel OpenLiteSpeed Server
  • Linux Server Performance Tuning

CyberPanel

9
  • Mounting /tmp on a Separate File
  • Updating CyberPanel Main VirtualHost Configuration
  • Updating CyberPanel vHosts Configuration
  • How to Change CLI PHP on CyberPanel
  • How to Update PHP Version to 8.1 in CyberPanel (From 7.3, 7.4, or 8.0)
  • CyberPanel Server Cleanup: Logs, Dumps, Backups
  • CyberPanel Full LSPHP Installation PHP 7.4 – 8.3
  • CyberPanel / OpenLiteSpeed: Clean LSPHP Session Files
  • SSL Certificate Management in CyberPanel via SSH

Hestia Control Panel

6
  • Fixing Email Bounce Back Issue in Hestia (Exim4 Blacklist Rejection)
  • Managing Fail2Ban in HestiaCP Server
  • Installing and Configuring PHP Versions in HestiaCP
  • phpMyAdmin Not Found in HestiaCP
  • Setting Up a Reverse Proxy for any Port in HestiaCP
  • How to Install Let’s Encrypt SSL in Hestia CP (Hostname, Admin Panel, and Email Server)

WHM/cPanel

6
  • Setting Up a Reverse Proxy on cPanel/WHM for Port 8081
  • How to increase the size of the cPanel-generated /tmp filesystem
  • Installing Old PHP Versions on a cPanel/WHM Server
  • Fixing “550: Your Country is Not Allowed to Connect to This Server” Error in Exim (cPanel)
  • Enable WP-CLI in CageFS on CloudLinux Servers (WHM/cPanel)
  • Securing /tmp and /var/tmp with a Dedicated Loopback Filesystem

Nagios

5
  • Service Checks
  • Uptime Checks
  • Disk Space Checks
  • Load Checks
  • Email Related Checks

WordPress

3
  • WordPress Core Reinstallation Guide
  • Managing WordPress Users via WP-CLI
  • Website Duplication, Migration, or Domain Change

Operating System

1
  • Server Reboot (RHEL or Centos based system)

AWS

1
  • How to Resize EBS Volumes on AWS

Databases

2
  • MySQL
    • Optimizing MySQL Performance
    • Recovering MySQL in Plesk When InnoDB Crashes

CloudLinux

4
  • Moving cagefs-skeleton directory
  • Enable WP-CLI in CageFS on CloudLinux Servers (WHM/cPanel)
  • Enable bc in CageFS on CloudLinux Servers(WHM/cPanel)
  • How to Upgrade MySQL 5.x to MySQL 8.0 on CloudLinux (WHM server) with MySQL Governor

Cloudflare

1
  • Configuring Security Headers in Cloudflare

ISPmanager

1
  • Install Free SSL (Let’s Encrypt) for domain.tld on ISPmanager with NGINX

Plesk

1
  • Plesk Admin Login Blocked – IP Restriction Recovery Guide

VPN

4
  • Install OpenVPN Open Source in Linux CentOS Ubuntu Debian Servers
  • Protected: OpenVPN Installation & Fix Wiki (CloudLinux / CentOS 7 & 8)
  • Outline VPN Installation & Management Guide
  • Installing AdGuard Home on Debian/Ubuntu (Docker)
View Categories
  • Home
  • Docs
  • Hestia Control Panel
  • Managing Fail2Ban in HestiaCP Server

Managing Fail2Ban in HestiaCP Server

Managing Fail2Ban in HestiaCP Server

Fail2Ban is a security tool that helps protect your server by banning IP addresses with suspicious activity, such as multiple failed login attempts. This guide covers how to check banned IPs and unban an IP in HestiaCP.

1. Check Banned IPs for All Jails
Run the following command to list banned IPs in each Fail2Ban jail:
for jail in $(sudo fail2ban-client status | grep -oP '(?<=Jail list:\s)(.*)' | tr ', ' '\n'); do 
echo "Banned IPs in $jail:"
sudo fail2ban-client status "$jail" | grep -i 'Banned IP list' -A 10
echo "--------------------------"
done

 Breakdown:
Retrieves all active jails from Fail2Ban.
Iterates through each jail and prints the list of banned IPs.
Displays results for each jail separately.

Unblock a Specific IP
To remove a specific IP from Fail2Ban’s blacklist, use:
fail2ban-client unban 127.0.0.1

Replace `127.0.0.1` with the actual IP you want to unblock.
This immediately removes the IP from all jails where it was banned.

Unblock an IP from a Specific Jail
If you know which jail banned the IP (e.g., `sshd`), unban it only from that jail:
fail2ban-client set sshd unbanip 127.0.0.1

Replace `sshd` with the appropriate jail name.

✅Unban all IPs from all jails (single command):
for jail in $(fail2ban-client status | grep "Jail list:" | cut -d: -f2 | tr -d ' ' | tr ',' ' '); do for ip in $(fail2ban-client status $jail | grep "Banned IP list" | cut -d: -f2); do fail2ban-client set $jail unbanip $ip; done; done

 

Restart Fail2Ban (if needed)
If you make configuration changes and need to restart Fail2Ban, use:
systemctl restart fail2ban

Conclusion
Use the first command to list banned IPs  in all jails.
Unban a specific IP using `fail2ban-client unban <IP>`.
If needed, unban an IP from a specific jail with `fail2ban-client set <jail> unbanip <IP>`.
Restart Fail2Ban only if necessary.

Table of Contents
  • 1. Check Banned IPs for All Jails Run the following command to list banned IPs in each Fail2Ban jail:
  • Unblock a Specific IP To remove a specific IP from Fail2Ban’s blacklist, use:
  • Unblock an IP from a Specific Jail If you know which jail banned the IP (e.g., `sshd`), unban it only from that jail:
  • ✅Unban all IPs from all jails (single command):
    • Restart Fail2Ban (if needed) If you make configuration changes and need to restart Fail2Ban, use:

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest

Was it helpful ?

  • Happy
  • Normal
  • Sad
  • About
  • Contact
  • Docs
  • Features
  • Home

© 2026 Panel Web Hosting

  • About
  • Contact
  • Docs
  • Features
  • Home