UPDATED: LATEST OC-VERSION 9.*
Fail2ban and owncloud are great tools!
To improve your security, you can ban bad guys, who want to hijack your owncloud accounts with random but common credentials, easily with fail2ban and the specific configuration for owncloud.
To make this as easy as possible for you, I wrote a shell script, which will setup everything with just one line:
curl -s "https://raw.githubusercontent.com/AykutCevik/owncloud-fail2ban/master/automated-install/install.sh" | bash
You can also use this command to update the regular expression for fail2ban, when a new version of owncloud is released. The script will check your installation and will update it automatically.
There is no black magic. Feel free to contribute and taking a look at the code at github.
The script has been tested with owncloud 9.0 & 9.1 and Ubuntu, but may also run under other versions and distributions. If not, please let me know.
For older versions (8.2, 8.1 & 8.0) of owncloud check out the github repo.