I have followed this how-to, but I have installed nextcloud 10.
The only changes that I had done to make that working are:
1. when I have to write "owncloud", I have written "nextcloud"
2. on file /usr/local/etc/fail2ban/jail.local, after the "# JAILS" comment, I have written the following content:
Code:
#
# JAILS
#
#
# NextCloud
#
[nextcloud]
enabled = true
filter = nextcloud
action = ipfw-nextcloud
logpath = /mnt/files/nextcloud.log
maxretry = 3
# 15 minute ban time
bantime = 900
# Look on the last 10 minutes of the log file
findtime = 600
port = 80,443
protocol = tcp
Please note that the logpath depends on the datafolder you use for nextcloud! So you'll have to change it for your installation!
2. On file /user/local/etc/fail2ban/filter.d/nextcloud.conf I have used the following content
Code:
[Definition]
failregex={"reqId":".*","remoteAddr":".*","app":"core","message":"Login failed: '.*' \(Remote IP: '<host>'\)","level":2,"time":".*"}
ignoreregex =
3. Changed or added line in file /usr/local/www/nextcloud/config/config.php
Code:
'loglevel' => '2',
'log_authfailip' => true,
'logtimezone' => 'UTC',