Installing fail2ban
apt-get install fail2ban
The fail2ban service keeps its configuration files in the /etc/fail2ban directory. There is a file with defaults called jail.conf.
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
Installing nginx, sendmail and iptables for more security apt-get install nginx sendmail iptables-persistent