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

Latest Posts

  • 4
    4 Types of Fungi that benefit your plant roots
  • How to generate Favicon for free online in 2020?
    How to generate Favicon for free online in 2020?
  • How to generate App Icon for free online ?
    How to generate App Icon for free online ?
  • What is the optimize Facebook profile picture size in 2020?
    What is the optimize Facebook profile picture size in 2020?
  • Why You Should Never Ever Buy XiaoMi Products ?
    Why You Should Never Ever Buy XiaoMi Products ?
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

Trending Posts

  • Logo Quiz Answers for iPhone, iPad, Android
    Logo Quiz Answers for iPhone, iPad, Android
  • Logo Quiz Emerging Games Answers
    Logo Quiz Emerging Games Answers
  • Logo Quiz Cheats
    Logo Quiz Cheats
  • Logos Quiz Answers
    Logos Quiz Answers

Interesting Posts

  • Hi Guess the Food Level 12,13,14,15,16 Answers Updated
    Hi Guess the Food Level 12,13,14,15,16 Answers Updated
  • Samsung Galaxy Gear Smartwatch coming on September 4
    Samsung Galaxy Gear Smartwatch coming on September 4
  • Most Expensive Durian
    Most Expensive Durian
  • Evil Spirit vs Angel
    Evil Spirit vs Angel
  • The Catholic Church of Chanthaburi
    The Catholic Church of Chanthaburi

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
Copyright © 2023 Justin.my | Powered by Juzhax Technology
 

Loading Comments...