Found amongst the security section of Linode's site (https://www.linode.com/docs/security), I decided to test out Fail2Ban in spite of having no valuable data stored on my VPS. I started with a simple installation :
apt-get update && apt-get upgrade -y
apt-get install fail2ban
apt-get install sendmail-bin sendmail
In /etc/fail2ban the fail2ban.local file is created using the 'touch' command, to enable local logging.
The settings in this file, edited with the 'nano' command, override the entries in the program's .conf file :
The four values in the 2nd picture are explained as following on Linode's site :
loglevel: The level of detail that Fail2ban’s logs provide can be set to 1 (error), 2 (warn), 3 (info), or 4 (debug).logtarget: Logs actions into a specific file. The default value of/var/log/fail2ban.logputs all logging into the defined file. Alternately, you can change the value to STDOUT, which will output any data; STDERR, which will output any errors; SYSLOG, which is message-based logging; and FILE, which outputs to a file.socket: The location of the socket file.pidfile: The location of the PID file.
The jail.conf file enables Fail2ban for SSH. In order to override this & edit its configuration, a jail.local file can be created, as before with the Fail2Ban.local file. Below are some configuration options edited with nano, with explanations above the console window :
Finally, in var/log/fail2ban.log, with a simple 'cat' command, we can see a number of failed login attempts from 2 different ips, which resulted in their banning for a very short (obviously extendable) period of 10 seconds, showing it's now operational :
|






















