Unable to connect to NC 12 server - ldap user password expired

Hi all,

I’m having issues with my NC server due to the LDAP connection user password expiring. All users on the server can’t log it, showing a nondescript ‘internal server connection error’. Reviewing the nextcloud logs, the password for the LDAP connection user has expired on the domain controller. Not a big issue, I can reset that user password on the DC…but now the LDAP credentials location is different than it used to be in OwnCloud =/

I’ve hunted around for an answer to my question - where is the LDAP connection data stored. Can’t find an answer to that.

My next thought was to simply log in as a non-ldap user, my management account for the NC server. Over the holidays, I clearly forgot that password too. Ouch! So - I found the string to reset the password while logged in as root on the server:

sudo -u www-data php occ user:resetpassword username

However, I think my config choices leave this string with the wrong syntax.

error: unknown user www-data

Set up:

Centos 7, php 7.1, mySQL, LDAP to server Windows 2012r2/2016

All advice welcome. I’m quick, but not a master of *nix. Given the data to find the ldap connection file or how to reset the admin account that isn’t an ldap user so I can get to the web portal to adjust the LDAP settings and I’ll be ready to rock and roll. Next time I’ll make sure I read emails over the holidays to not let an important user password expire while I’m not looking :frowning:


I remembered something! www-data isn’t what you use for centos apache setups. I could be mistaken, but I tried this:

sudo -u apache:apache php occ user:resetpassword username

Which failed with unknown user, so I dropped the :apache

sudo -u apache php occ user:resetpassword username

And got the error:

Could not open input file: /var/www/nextcloud/occ

From there, I’m still stuck, but moving along I think.

Never stop the pain train my friends - found another mistake of mine:

directory for me is /var/www/html/nextcloud/occ

So I fixed that, and then I get the prompt: do you want to continue? yes

“Private Key is missing for user: please try to log-out and log-in again”

Cool - no need to panic right? RIGHT! Successfully logged in, changed the pass on the DC, updated the LDAP connection, and we’re back on track. Thanks for tuning in. I’m back up and running. Sometimes just writing it out helps the sticky old brain.

1 Like