Skip to content

Instantly share code, notes, and snippets.

@psujit775
Last active March 27, 2022 09:46
Show Gist options
  • Save psujit775/31e0b9b5d4976b8456525b4463a5b829 to your computer and use it in GitHub Desktop.
Save psujit775/31e0b9b5d4976b8456525b4463a5b829 to your computer and use it in GitHub Desktop.
fail2ban conf
[sshd]
enabled = true
#call iptables to ban IP address
banaction = iptables-multiport
#ban on all ports
banaction_allports = iptables-allports
bantime = 31536000 #this is one year ban time
#bantime = -1 this will ban permanently
# A host is banned if it has generated "maxretry" during the last "findtime"
findtime = 5m
# "maxretry" is the number of failures before a host get banned.
maxretry = 3
#whitelist your ip address by comma seperated.
ignoreip = 127.0.0.1
#user will be banned for 1 year if it fails auth 3 times in last 5 minutes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment