How to Whitelist an IP in Fail2ban on Debian Linux
Fail2ban is a popular tool for securing your VPS server by blocking malicious IPs. Sometimes, you may need to whitelist certain IP addresses to prevent them from being banned. Here’s how to do it:
Step 1: Access Your Server
Log in to your Debian VPS server via SSH:
ssh your_username@your_server_ip
Step 2: Open the Fail2ban Configuration File
You can add IPs to the whitelist by editing the jail.local configuration file. Use your preferred text editor:
sudo nano /etc/fail2ban/jail.local
Step 3: Add the Whitelisted IP
Find the section for the specific jail (e.g., sshd) and add your IP to the ignoreip line. If it’s not present, you can create it:
ignoreip = 127.0.0.1/8 YOUR_WL_IP
Replace YOUR_WL_IP with the IP address you want to whitelist.
Step 4: Save and Exit
After making the changes, save the file and exit the text editor. In Nano, you can do this by pressing CTRL + X, then Y, and Enter.
Step 5: Restart Fail2ban
To apply the changes, restart the Fail2ban service:
sudo systemctl restart fail2ban
Conclusion
Your specified IP address should now be whitelisted in Fail2ban. If you’re looking for a reliable VPS server, consider checking out NetCloud24 VPS Servers.