Advertisement
memugome

fail2ban-centos7

Dec 16th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. yum install epel-release
  2. yum install fail2ban
  3. systemctl enable fail2ban
  4. nano /etc/fail2ban/jail.local
  5. [DEFAULT]
  6. # Ban hosts for one hour:
  7. bantime = 3600
  8. # Override /etc/fail2ban/jail.d/00-firewalld.conf:
  9. banaction = iptables-multiport
  10. [sshd]
  11. enabled = true
  12. #untuk http auth
  13. [nginx-http-auth]
  14. enabled = true
  15.  
  16. #restart fail2ban
  17. systemctl restart fail2ban
  18.  
  19. #check fail2ban status
  20. fail2ban-client status
  21.  
  22. #additional setting
  23. nano /etc/fail2ban/jail.conf
  24. ignoreip = 127.0.0.1/8
  25. #tambah ignoreip = 127.0.0.1/8 ipserver1
  26. bantime = 600
  27. findtime = 600
  28. maxretry = 3
  29.  
  30. #cek log
  31. tail -F /var/log/fail2ban.log
  32.  
  33. #unbanip
  34. fail2ban-client set ssh unbanip 10.0.0.20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement