I block persistent abusers when I notice them or they show up in Fail2Ban on a regular basis. I use the following script so I can do it easily and get a log of what was blocked (and why).
The blocks are not persistent across reboots, but I use another script to save blocks that are then reloaded on reboot.
I do use a non-standard SSH port simply to make it easier to track who is having problems connecting and reduce the script kiddie noise.
Code:
#!/bin/bash
# tempblock IPADDDRESS Comment
# tempblock IPADDRESSS/CIDR Comment
LOGFILE='/var/log/tempdrop.log'
DATE=`date +"%Y-%m-%d %H:%M:%S"`
# Did we get a value?
if [ $# -eq 0 ]
then
echo "$0 : Need To Provide IP or IP/CIDR to add temp drop"
exit 1
fi
echo
echo "Temp Drop IP Block [$1] - $2"
echo "Adds temp drop for IP at the top of the chain"
echo "--------------------------------------------------------------"
echo CMD: iptables -I INPUT -s $1 -j DROP
/sbin/iptables -I INPUT -s $1 -j DROP
echo "$DATE DROP [$1] - $2" >> $LOGFILE
## End
Example: tempdrop 111.241.0.0/16 "TW Fake email Attempts"