Duncan Wither

Home Notes Github LinkedIn

General Tips

Some general tips (that I might disagree with) from This Video:

This is another good self hosting guide with security stuff included.

SSH + RSA

Fail2Ban

Fail to ban protects people from brute forcing their way into your server.

To install:

sudo apt-get install fail2ban

The global settings are stored in /etc/fail2ban/jail.conf. It’s poor practice to modify this directly (as updates modify this file) but instead copy it to jail.local and modify it. jail.local will overwrite the jail.conf rules.

Under the [DEFAULT] header1 here’s some key settings to modify:

More settings can be found in this tutorial.

Then to start banning run:

sudo service fail2ban restart

To see if things are getting banned run:

sudo zgrep 'Ban' /var/log/fail2ban.log*

And pass it into wc -l to see how many bans have occurred.


  1. The [DEFAULT] header is the base rules, individual rules can be made up for different protocols on different ports. But for my server uses, just modifing [DEFAULT] works a treat.↩︎