https://github.com/lldap/lldap logo
lowk3y - Hey it seems I've locked out of my adm...
# troubleshooting
l
Hey it seems I've locked out of my admin in lldap. How can I reset the password?
a
message has been deleted
t
Is the data in your instance important or are you just testing?
l
it is importnat 🙂 don't wanna loose anything
n
There's a config option for "force reset admin password" or something to that effect
It'll use the password from the config
(default is "password" if you haven't set it)
l
How to force this?
Password was changed i guess
n
Yeah, that's what I'm saying, there's a config option
And the matching environment variable
Sorry, I'm on my phone, I can't find the exact name
l
Thx - that worked!
b
Hey I'm sorry to be hijacking someone else's thread, but is there a way to do that if you have lldap installed from a repository, not in docker?
t
Well, you still have a config.toml file right? Just change the same variable and it should work
b
I do, yes, I've tried changing the admin username and password multiple times, but nothing seems to work. Logs just say opaque login attempt for "admin"
t
Have you restarted the service?
b
I have, yes
t
And you do have a value set for the admin password in the
config.toml
?
b
Yes.
t
Can I see your config.toml (without sensitive date if applicable)
Also, is the password set in the config.toml long enough? It will not work if it's under 8 characters if I remember correctly
b
It is exactly 8 characters right now
Let me just sanitize the config file
t
What distro are you on?
n
You can also start LLDAP in verbose mode and it'll dump the config (parsed) to the logs, with the secrets redacted
b
I'm running lldap in a debian container on a proxmox server, not in docker
I indeed do not have the force password reset setting set
t
Let me know if it works when you do yet it to either
true
or
"always"
b
No work. I'm somewhat puzzled now though, is it possible lldap is reading a config I haven't edited? The ldap_base_dn in the log is set to example.com for instance
Is there a config.toml that's not in/ etc/lldap?
t
Where did you store your config file?
b
/etc/lldap/lldap_config.toml
n
Check your service file for the path to the config
If it doesn't get a config path on the command line, it'll look in the binary directory only
b
I haven't been running it as a service, just a plain old "lldap run"
Oh I see
n
(note to self: print the path to the config file that's read)
t
xD
b
The
lldap --help
doesn't say how to tell it what config file to use
n
Oh, it does print the path! Nevermind 🙂
lldap run --help
?
Wrong thread?
t
Oop sorry
b
Brainfart, no run in that line
Just
lldap --help
n
Depending on the action you want to take, the config might not be relevant, so it's not always shown 🙂
b
I understand, yea. I'm still lost as to how exactly to make it use my config though, just
lldap run /etc/lldap/lldap_cobfig.toml
or is it something more involved?
n
lldap run --help
should tell you that there is a
--config_file
option
Or
lldap help run
b
Ah I see.
I am still having trouble, it's saying it will not change my password
Copy code
nov 24 23:59:01 ldap-server lldap[5260]: Error: while resetting admin password for admin
nov 24 23:59:01 ldap-server lldap[5260]: Caused by:
nov 24 23:59:01 ldap-server lldap[5260]:     0: Database error: `None of the records are updated`
nov 24 23:59:01 ldap-server lldap[5260]:     1: None of the records are updated
nov 24 23:59:01 ldap-server systemd[1]: lldap.service: Main process exited, code=exited, status=1/FAILURE
nov 24 23:59:01 ldap-server systemd[1]: lldap.service: Failed with result 'exit-code'.
I am so sorry to keep wasting your time
n
That is... Very strange
Oh, wait, I think that could happen if you don't have an existing DB
b
but I do
n
By default, the DB will be created next to the binary, I think
But when you set the config, it loaded a different path
(which started out as empty)
b
the default db should just be called users.db, is it?
t
Correct
b
the binary is just in /bin/
users.db is in /var/lib/lldap/
and it does have my previously used users in it, along with my admin account
also, no "users.db" in /bin/
t
What you could do is to edit the config and change the DB parameter to
database_url: "sqlite:///var/lib/lldap/users.db?mode=rwc
Just to be sure it uses the var lib DB
b
it is already set up like that
t
You sure? In the debug dump you sent it was not
b
yes the debug dump I set wasn't using the right config
t
Aaaa cool
Is there anything important in the your current LLDAP setup?
b
some users, but I could just as well reset them I think
t
You could delete it, but you'd loose all data
Might solve your DB issues
I have to go now, good luck!
b
thank you so much for your help. I will try to figure something out, if it doesn't work, I will just delete the db.
Thank you!
n
My guess is that the users.db in /var/lib is the new one, and you have another one somewhere else with your users (maybe home directory, or whatever your pwd was when you run LLDAP)
b
I didn't manage to find another users.db file, and considering I've used lldap successfully before I think the pwd was /var/lib/lldap like what it says in the config file. I'm not sure what exactly broke. I managed to make it let me log in for now, what I did was rename users.db to users.db.old, made it create a new, empty users.db, successfully signed into the webui, and then swapped the new, empty db, with the old db with all the users in. After signing out the new admin it let me sign in with my old admin account and everything. Only thing now seems to be that none of the services connected let me connect. Dokuwiki says it can't connect to lldap. I'll figure something out eventually. Thank you both for all the help.