Skip to content
Justin.my
  • Games
  • iPhone
  • Android
  • Photos
  • Linux
  • Search
  • Home
  • 2012
  • March
  • How to Install fail2ban on CentOS in DirectAdmin

How to Install fail2ban on CentOS in DirectAdmin

How to Install fail2ban on CentOS in DirectAdmin

March 24, 2012 March 24, 2012 / By Justin Soo / Linux, Notes, Security

How to Install fail2ban on CentOS in DirectAdmin

Login using root

[[email protected]:~ ] $ yum install fail2ban
vi /etc/fail2ban/filter.d/dovecot-pop3imap.conf

Add this to the file dovecot-pop3imap.conf

[Definition]
failregex = dovecot: auth-worker\(default\): sql\(.*,\): unknown user
dovecot: (pop3|imap)-login: Aborted login \(.*\): .*, \[\]
dovecot: (pop3|imap)-login: Disconnected \(auth failed, .*\): .*, \[\]
dovecot: auth\(default\): passdb\(.*,\)\: Attempted login with password having illegal chars
dovecot: (pop3|imap)-login: Disconnected \(auth failed, .*\): .*, \[\]
dovecot: (pop3|imap)-login: Aborted login: .*, \[\]
ignoreregex =


How to Install fail2ban on CentOS in DirectAdmin

Then edit the file jail.conf to enable it.

vi /etc/fail2ban/jail.conf

Add this to the file

[dovecot-pop3imap]
enabled = true
filter = dovecot-pop3imap
action = iptables-multiport[name=dovecot-pop3imap, port="pop3,pop3s,imap,imaps", protocol=tcp]
sendmail-whois[name=dovecot-pop3imap, dest=root, [email protected]]
logpath = /var/log/maillog
maxretry = 20
findtime = 1200
bantime = 1200

Try to start the service

[[email protected]:/etc/fail2ban/filter.d ] $ service fail2ban start
Starting fail2ban: [ OK ]

 

Make sure service is start while boot up.

chkconfig fail2ban --level=235 on

Check is it working or not.

[[email protected]:/etc/fail2ban/filter.d ] $ service fail2ban status
Fail2ban (pid 13009) is running...
Status
|- Number of jail: 2
`- Jail list: dovecot-pop3imap, ssh-iptables

 

You can see the attacks getting blocked in /var/log/messages  depending on your value of logtarget in /etc/fail2ban/fail2ban.conf

Tags:

  • Auto
  • block brute force
  • brute force
  • CentOS
  • directadmin
  • Dovecot
  • Fail2ban
  • Gmail
  • how to install fail2ban
  • how to stop brute force
  • installing fail2ban
  • iptables in directadmin
  • Linux
  • login
  • security
  • Servers

Post navigation

← Previous Post
Next Post →

Buy Me a Coffee

Buy me a coffeeBuy me a coffee

Recent Posts

generate favicon for free online 2020
How to generate Favicon for free online in 2020?
December 17, 2019
generate app icon for free online
How to generate App Icon for free online ?
December 16, 2019
optimize facebook cover 2020
What is the optimize Facebook profile picture size in 2020?
December 15, 2019
Why You Should Never Ever Buy XiaoMi Products 03
Why You Should Never Ever Buy XiaoMi Products ?
February 27, 2019
Wordscapes In Bloom Answers
Wordscapes In Bloom Answers
May 21, 2018

Trending Posts

Logo Quiz Answers
Logo Quiz Answers for iPhone, iPad, Android
December 8, 2012
Logos Quiz Answers
Logos Quiz Answers for Addictive Mind Puzzlers
June 26, 2012
Bag It
Bag It Walkthrough
June 10, 2012
Logo Quiz
Logo Quiz Cheats
May 13, 2012
logos quiz answers level 1
Logos Quiz Answers
April 30, 2012
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Our Projects

  • Game Solver
  • Words Solver
  • Top Hashtags
  • Rumors City
  • Thamai
  • @juzhax
  • Plot Map
  • Top Radio
  • Secret Specs

Support

  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy

Follow Us

  • Facebook
  • Twitter
  • YouTube
  • RSS Feed
  • Instagram
  • LinkedIn
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
Copyright © 2021 Justin.my | Powered by Juzhax Technology