Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Install and Setup Fail2Ban on OwnCloud portsjail

Western Digital Drives - The Preferred Drives of FreeNAS and TrueNAS CORE
Status
Not open for further replies.

MrUnknownEMC

Member
Joined
Feb 20, 2016
Messages
55
That log path looks like one for a plugin. All the instructions in this thread are about owncloud in a jail. I assume that fail2ban could be setup to work with owncloud as a plugin, but some of the paths would differ from those described in this thread.

Did you install the owncloud plugin, or did you manually create a jail and put owncloud in the jail?
I tried to install owncloud manually but i couldn't get up an working, currently it running by owncloud plugin. Do you know where should the correct pathway be?
 

Kevin Horton

Neophyte Sage
Joined
Dec 2, 2015
Messages
692
I tried to install owncloud manually but i couldn't get up an working, currently it running by owncloud plugin. Do you know where should the correct pathway be?
No idea. I don't use any plugins currently.

What do you see for log location if you look at the owncloud configuration settings file? I'm on the road for several weeks, and for some crazy reason the network at this hotel is stopping me from connecting to the VPN server at home, so I cannot check what the name of the configuration file is. It should be in usr\pbi\owncloud-amd64\www\owncloud, or one of its subfolders.
 

MrUnknownEMC

Member
Joined
Feb 20, 2016
Messages
55
No idea. I don't use any plugins currently.

What do you see for log location if you look at the owncloud configuration settings file? I'm on the road for several weeks, and for some crazy reason the network at this hotel is stopping me from connecting to the VPN server at home, so I cannot check what the name of the configuration file is. It should be in usr\pbi\owncloud-amd64\www\owncloud, or one of its subfolders.
That is where i found my owncloud.log but there were nothing it in. Just a blank file.
 

Zofoor

Member
Joined
Aug 16, 2016
Messages
212
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',
 
Last edited:
Status
Not open for further replies.
Top