How to refer to Nextcloud log on another server for fail2ban

Hello,

I’ve set up Nextcloud on one Raspberry Pi, and it’s being served via a reverse proxy via another Raspberry Pi on the same network.

Now, I’d like to set up fail2ban on the reverse proxy to make use of Nextcloud’s logs, according to the admin manual. The fail2ban jail includes a reference to the Nextcloud logs, which should be updated accordingly:

logpath = /path/to/data/directory/nextcloud.log

However, how could I refer to a log on another IP address? I suppose listing the local IP address and path won’t work (I’m a rather noob, so this may seem stupid).

I could set up a cron job that regularly copies the log from the one to the other machine. But I suppose there’s a better way to organise this :slight_smile:

Any help or suggestions are welcome!

Hi,

My understanding is that wouldn’t be the Ip but rather the actual location of the file.
So probably need to create a share on the 2nd server, mount it give RW access to failban then pass it to the 1st server in the form of /path to the mount where the log is/.

There may be other solutions but this is my understanding

1 Like

One possibility would be to use SSHFS with public key authentication and remotely mount the specific directory containing the log file. Then you specify the mount point in your jail.local configuration file

Is it not sufficient to use the standard functions of Nextcloud?

Brute force protection

@devnull True, one can configure that for the reverse _proxy :slightly_smiling_face: I had missed it was the proxy and was thinking it was another remote server