1
2
3
4
5
6
7
8
9
sudo apt-get install -y fail2ban

cat << EOF | sudo tee /etc/fail2ban/jail.d/sshd.local
[sshd]
enabled = true
port = 23422
EOF

sudo systemctl reload fail2ban