Internal IP blocked - can't unblock - quite frustrating


I’m at my wits end here. I accidentally blocked my internal ip address from nextcloud.

I have searched through these forums and tried the following:

  1. mysql -e “use nextcloud;select * from oc_bruteforce_attempts;” – saw my ip in the results
  2. mysql -e “use nextcloud;delete from oc_bruteforce_attempts;”

Requeried using # 1 statement, and nothing is returned in the query. However, still cannot access the login screen.

Tried to access Nextcloud with my laptop with ip and login screen appears and I can log in. Went to the bruteforce ip whitelist and added range.

Tried with my other computer and was able to login as well.

Still cannot access with

rebooted server… still no go.

Something is wrong here. What must I do?

Nextcloud vers: 25.0.4
PHP 8.1.16
mysql 10.5.18

hello @ckl_88 welcome to the forum :handshake:
Please use the search - lot of issues have been discussed already

in general you should not directly poke with the DB, better use official methods e.g. occ security:bruteforce:reset

I did use the search. That’s how I found the mysql commands.

for the occ command, the manual says I have to run it as the HTTP user. For my install, Debian/Ubuntu, the occ user is www-data. However, when I run it, I get this:

su -l www-data occ security:bruteforce:reset
This account is currently not available.


should add php

su -l www-data php occ security:bruteforce:reset IP

On most Linux systems www-data account is blocked from login interactively (for good security reasons) but that restriction can be removed temporarily.

You can temporarily unblock an account by executing

usermod -s /bin/bash www-data

After the task is completed please revert the changes using

usermod -s /usr/sbin/nologin www-data

Thanks. I ended up installing the occ app and running the commands from there.

1 Like

FYI it’s:

sudo -u www-data php /var/www/nextcloud/occ security:bruteforce:reset IP