Sorry to ask this question - but I have been browsing forums and threads on this subject and seem to confuse myself more than actually getting any clarity. All I need is a short and concise answer for this problem:
How do a setup a (chain) rule in iptables which rejects any source which fails to gain access to the server after XX attempts within YY minutes, so that any further attempt to contact the server is rejected before password is being matched for ZZ minutes. After ZZ minutes after the last attempt to connect, the rule must allow the same source to retry its attempt as if it had never attempted to reconnect before.
- I assume this has to be written as a new chain rule.
- I assume the chain rule has to be saved to iptables, so that the rule is resumed at reboot.
- I assume the chain rule needs some kind of logging.
My problem is that I don't understand the iptables syntax disregarding how much I study it, and hence I'm grateful for the shortest "script type" answer on this question