Protect SSH with Fail2Ban on CentOS 6

Fail2Ban is an SSH security program that blocks SSH brute force attempts on your server (as well as for many other services such as Apache, Nginx, webmail, etc). Installing it is quite simple and can be done in a few steps:

1. Login to your VPS as root

2. Run the following commands (and press y when asked):

yum install epel-release
yum install fail2ban



3. Now copy the configuration file template:

cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local



4. Start up the Fail2Ban service:

service fail2ban restart



5. The default settings are usually adequate, but you can further customize Fail2Ban by editing the config file located here:
/etc/fail2ban/jail.local
Make sure to restart the service after changing settings.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

A-Z Index of the Linux BASH command line

An A-Z Index of the Linux BASH command line alias Create an aliasapropos Search Help manual...

Changing The SSH Port

While there are many ways to make sure your server is as secure as possible there are some basic...

Check and open ports in CentOS / Fedora / Redhat

  If you want to open or close a port for a Linux firewall you have to edit the rules in...

Clear Memory Cache on Linux Server

By default the Linux OS has a very efficient memory management process that should be freeing any...

Create email accounts using ssh

/scripts/addpop user_id@yourdomains.com user_password Do below mentioned steps for configuration...