things like scp and rsync recycle connections across files though, so it hasn't been a problem in practice; ansible does too if you use openssh instead of paramiko
ps -- if someone knows iptables well, and is willing to share a similar script for failed connections, I would be grateful! But doing this across all ssh connections was easy enough that even I managed to get it working.
while whatever ; do
# hit host with a ssh command numerous times in loop
ssh user@host command ...
...
done
Banning more than X failed connection attempts from an IP in Y minutes is done with utilities like fail2ban, which wheedle that information from system logs.
It's not a bad policy overall, but of course it interferes with a legitimate use: a script which rapidly executes numerous SSH commands.