From 6e5f3c1be5b930fcf502ed9564580fd89ee16be0 Mon Sep 17 00:00:00 2001 From: Pratik Tripathy <> Date: Sat, 11 Oct 2025 19:42:22 +0530 Subject: [PATCH] fix(fail2ban): Use https protocol to get the server IP --- init-linux-harden.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init-linux-harden.sh b/init-linux-harden.sh index f42f721..bb1b1ea 100755 --- a/init-linux-harden.sh +++ b/init-linux-harden.sh @@ -758,7 +758,7 @@ fail2ban_jail_settings() { # Get server's public IP file_log "Getting server's public IP..." - PUBLIC_IP=$(curl -s -4 ifconfig.me 2>&1 || curl -s -4 icanhazip.com 2>&1 || curl -s -4 ipinfo.io/ip 2>&1) + PUBLIC_IP=$(curl -s -4 --max-time 10 --fail https://ifconfig.me 2>&1) file_log "INFO" "Server public IP: $PUBLIC_IP" file_log "INFO" "Adding jails to $JAIL_LOCAL..."