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

**URL:** <https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731>\
**Category:** ℹ️ Support\
**Tags:** bruteforce\
**Created:** [December 2, 2016, 4:49pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731 "2016-12-02T16:49:39Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukas](https://help.nextcloud.com/user_avatar/help.nextcloud.com/lukas/32/969_2.png) [@lukas](https://help.nextcloud.com/u/lukas)\
**Post date:** [December 2, 2016, 4:49pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/1 "2016-12-02T16:49:39Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Schmu](https://help.nextcloud.com/user_avatar/help.nextcloud.com/schmu/32/7823_2.png) [@Schmu](https://help.nextcloud.com/u/Schmu)\
**Post date:** [December 2, 2016, 5:22pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/2 "2016-12-02T17:22:33Z")

</div>

Hi,

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

---

<div class="post-metadata">

**Author:** ![lukas](https://help.nextcloud.com/user_avatar/help.nextcloud.com/lukas/32/969_2.png) [@lukas](https://help.nextcloud.com/u/lukas)\
**Post date:** [December 2, 2016, 5:55pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/3 "2016-12-02T17:55:43Z")

</div>

Works again! Thank you! 🙂

---

<div class="post-metadata">

**Author:** ![BenBold](https://help.nextcloud.com/letter_avatar/benbold/32/5_5575768a8748004e209b776fc1b2916d.png) [@BenBold](https://help.nextcloud.com/u/BenBold)\
**Post date:** [October 2, 2017, 3:48pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/4 "2017-10-02T15:48:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lukas](https://help.nextcloud.com/user_avatar/help.nextcloud.com/lukas/32/969_2.png) [@lukas](https://help.nextcloud.com/u/lukas)\
**Post date:** [October 2, 2017, 4:01pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/5 "2017-10-02T16:01:13Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![BenBold](https://help.nextcloud.com/letter_avatar/benbold/32/5_5575768a8748004e209b776fc1b2916d.png) [@BenBold](https://help.nextcloud.com/u/BenBold)\
**Post date:** [October 2, 2017, 4:04pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/6 "2017-10-02T16:04:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lukas](https://help.nextcloud.com/user_avatar/help.nextcloud.com/lukas/32/969_2.png) [@lukas](https://help.nextcloud.com/u/lukas)\
**Post date:** [October 2, 2017, 4:14pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/7 "2017-10-02T16:14:14Z")

</div>

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`).

---

<div class="post-metadata">

**Author:** ![Calmly](https://help.nextcloud.com/user_avatar/help.nextcloud.com/calmly/32/5865_2.png) [@Calmly](https://help.nextcloud.com/u/Calmly)\
**Post date:** [October 2, 2017, 6:33pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/8 "2017-10-02T18:33:05Z")

</div>

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

HTH

---

<div class="post-metadata">

**Author:** ![BenBold](https://help.nextcloud.com/letter_avatar/benbold/32/5_5575768a8748004e209b776fc1b2916d.png) [@BenBold](https://help.nextcloud.com/u/BenBold)\
**Post date:** [October 5, 2017, 4:45pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/9 "2017-10-05T16:45:33Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Schmu](https://help.nextcloud.com/user_avatar/help.nextcloud.com/schmu/32/7823_2.png) [@Schmu](https://help.nextcloud.com/u/Schmu)\
**Post date:** [June 25, 2018, 4:47pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/10 "2018-06-25T16:47:39Z")

</div>

A post was split to a new topic: [What could block my IP. Tried to unblock without success](https://help.nextcloud.com/t/what-could-block-my-ip-tried-to-unblock-without-success/33360)

---

<div class="post-metadata">

**Author:** ![Wikinaut](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wikinaut/32/12187_2.png) [@Wikinaut](https://help.nextcloud.com/u/Wikinaut)\
**Post date:** [May 13, 2020, 4:45pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/11 "2020-05-13T16:45:47Z")

</div>

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;"`

---

<div class="post-metadata">

**Author:** ![TheRojam](https://help.nextcloud.com/user_avatar/help.nextcloud.com/therojam/32/27774_2.png) [@TheRojam](https://help.nextcloud.com/u/TheRojam)\
**Post date:** [June 17, 2021, 3:27pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/12 "2021-06-17T15:27:35Z")

</div>

You can also use the [occ client](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html?highlight=occ#security-commands-label):  
`$ 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:

```auto
 '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.

---

<div class="post-metadata">

**Author:** ![Pascacio](https://help.nextcloud.com/letter_avatar/pascacio/32/5_5575768a8748004e209b776fc1b2916d.png) [@Pascacio](https://help.nextcloud.com/u/Pascacio)\
**Post date:** [August 22, 2022, 3:45pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/14 "2022-08-22T15:45:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pascacio](https://help.nextcloud.com/letter_avatar/pascacio/32/5_5575768a8748004e209b776fc1b2916d.png) [@Pascacio](https://help.nextcloud.com/u/Pascacio)\
**Post date:** [August 22, 2022, 3:56pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/15 "2022-08-22T15:56:31Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Brecht\_W](https://help.nextcloud.com/user_avatar/help.nextcloud.com/brecht_w/32/46572_2.png) [@Brecht\_W](https://help.nextcloud.com/u/Brecht_W)\
**Post date:** [October 14, 2022, 11:03am UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/16 "2022-10-14T11:03:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [November 6, 2024, 8:47pm UTC](https://help.nextcloud.com/t/how-can-i-unblock-an-ip-blocked-through-brute-force-detection/5731/17 "2024-11-06T20:47:07Z")

</div>

wwe: close old topics
