How can i unblock an IP (blocked through brute force detection)?

Somehow, i managed to be blocked on my nextcloud instance (nc 11 beta). Seems like i’ve made too much failing login attempts through thunderbird.
No my connection is throttled. How can i unban my IP? Is there a time-limit on the ban?

Hi,

connect to mysql and run the following query for your IP:
DELETE FROM oc_bruteforce_attempts WHERE ip = 'aaa.bbb.ccc.ddd';

6 Likes

Works again! Thank you! :slight_smile:

I have no experience with SQL - is it possible to administrate this in the admin section?

@BenBold hey, i can assist you. It’s not possible to do this within an admin session.
How do you host your instance? Have you access to the database?

well - its running on our web server preinstalled by the webhoster - very nice so far.
but just one account is blocked now.

i have ssh access to the server.

Is the database running on the same server you have access to?
Then you could start the mysql-console with something like: mysql --user=user_name --password db_name).

Alternatively, you could just add the IP address in Admin --> Security --> Brute-force IP whitelist :slight_smile:

HTH

4 Likes

Thank You Calmly !!
That was solving a lot of problems but i still get the following message for the calendar:

Warning core Login failed: ‘UserName’ (Remote IP: xxxxxx)

A post was split to a new topic: What could block my IP. Tried to unblock without success

Run (as root)

To show entries:
mysql -e "use nextcloud;select * from oc_bruteforce_attempts;"

To delete all these entries:
mysql -e "use nextcloud;delete from oc_bruteforce_attempts;"

1 Like

You can also use the occ client:
$ php occ security:bruteforce:reset <ip-adresse>

If you have an reverse proxy runnig you may want to add some special things to your nextcloud config.php:

 'trusted_proxies' => array('192.168.1.1'),
 'forwarded_for_headers' => array('HTTP_X_FORWARDED_FOR'),

While 192.168.1.1 is the local IP address of your reverse proxy.

3 Likes

Hi, it seems that option was removed in the actual version , 24.0.4.

Hi, I’m running Nextcloud on Hestia, from these commands I get " Unknown database ‘nextcloud’"
Also tried with "sudo -u www-data php /var/www/nextcloud/occ security:bruteforce:reset but it seems the wrong directory. Does anyone know the right path for Hestia CP installation?
thank you!

This helped me.
After a year i received this issue and i think it was because of this:
‘forwarded_for_headers’ => array(‘HTTP_X_FORWARDED_FOR’)

Thank you