[Fix] VestaCP Fail2ban Not Starting/Working

To fix the fail2ban not working/starting issue in VestaCP (Centos 7), follow these steps:

Go to SSH and edit “/usr/local/vesta/bin/v-list-sys-services” file (I suggest you to use nano).

Find this:

# Checking FIREWALL Fail2ban extention
if [ ! -z “$FIREWALL_EXTENSION” ]; then
get_srv_state $FIREWALL_EXTENSION fail2ban-server script
data=”$data\nNAME=’$FIREWALL_EXTENSION’ SYSTEM=’brute-force monitor'”
data=”$data STATE=’$state’ CPU=’$cpu’ MEM=’$mem’ RTIME=’$rtime'”
fi

Replace with this:

# Checking FIREWALL Fail2ban extention
if [ ! -z “$FIREWALL_EXTENSION” ]; then
get_srv_state $FIREWALL_EXTENSION f2b/server script
data=”$data\nNAME=’$FIREWALL_EXTENSION’ SYSTEM=’brute-force monitor'”
data=”$data STATE=’$state’ CPU=’$cpu’ MEM=’$mem’ RTIME=’$rtime'”
fi

Save the file and exit. That’s all. You don’t need to do anything after this. Fail2ban will start automatically.

Leave a Reply

Your email address will not be published. Required fields are marked *