How To Protect SSH With Fail2Ban on CentOS 8

Originally published at:

My ssh log file shows too many password failures. Random IP address trying to brute force my sshd server running on CentOS 8 server. How do I protect ssh with fail2ban on CentOS 8 Linux server? How do I install Fail2Ban on CentOS 8?


I have a question regarding fail2ban and nftables. In the example on in the jail.local the banaction related to iptables

banaction = iptables-multiport

does this work with nftables without further changes?


Hi @mike_k

Yes, it should work. nftables is included with CentOS 8/RHEL 8. So no need to worry.