But, yes. There's an iptables module called ipt_recent[1] that will do what you're after. It's been built-in for ages and you don't need to install it.
You can't use it by itself, though. You will have to design a full iptables ruleset.
echo " (eth0 - SSH rate check)"
iptables -N SSH_CHECK
iptables -A SSH_CHECK -m recent --set --name SSH
iptables -A SSH_CHECK -m recent --update --seconds 60 --hitcount 3 --name SSH -j DROPAssuming that's true, now guess what happens when you do this during a crisis:
for i in backup-file-{0..999}; do
scp $i that-machine:/var/db/
done
Unless you're muxing in your local SSH config, you will cause the firewall to intervene on you during the absolute worst time, and you will have no idea why. Promise.I really wish we could reverse the trend of fiddling with iptables when it comes to SSH. Everybody does it and nobody thinks about the ramifications.
The global limit on scp is fine; this is an internet-facing server with minimum user data for which I have a cold spare - there's nothing to back up.
You're coming over like you're the only person in the world who knows what they're doing; might want to rethink that.