lost admin password
-
You can just create another account and give it admin privileges from redis-cli. Then you can change the password of your original account with this new admin.
First create a user as normal. Note down their username.
Now go into redis-cli and find the gid of the admin group.
hget group:gid administrators
(1)Then get the uid of the new user
hget username:uid <username>
(2)Now add the uid of the user name to the admin group.
sadd gid:<replace with value from step 1>:members <replace with value from step 2>
Let me know if that helps. Not sure why the email plugin is not working.
-
@baris OK, I needed to restart nodebb - was getting a 403 on that
-
Hello @colornote, sorry to hear you got locked out!
The instructions have changed as the schema has changed.
Now:
- First create a user as normal. Note down their username.
- Get the uid of the new user:
hget username:uid <username>
sadd group:administrators:members <replace with value from step 2>
-
@julian Thank you!
I use another way which you offer, and reset the admin's password successfully.To reset the password even if no email is installed:
- Go to
/reset
and key in your email. It won't send out the password reset email, but a key will be generated. This key expires after 2 hours. redis-cli
to enter the redis console. If redis is installed on a different port, host, or socket, use-p
,-h
, and-s
respectivelyhgetall reset:uid
, and locate the reset id corresponding to your uid- Go to
/reset/{reset-uid}
- Go to
-
I use mongodb, here is the solution: // I just wanted to share
// Show collections
show collections
// Find the userid you want to add to the
db.objects.find( { "_key" : "username:uid" } )
// Find members id in administrators group
db.objects.find( { "_key" : "group:administrators:members" } )
// To update, 3 was my userid
db.objects.update( { "_id" : ObjectId("54022b7f60757d4944a05931") }, { "_key" : "group:administrators:members", "members" : [ "1", "2", "3" ] }, { upsert: true }More info here
http://docs.mongodb.org/manual/reference/mongo-shell/ -
Slight Update To Jenkler's approach, not sure in which version this changed* but:
modify the key "value" with the array of users you want to give admin permissions to
"value" : [ "1", "2" ]as opposed to
"members" : ["1","2"]Note: the ObjectId() used in the first parameter of the update query is the id of the object found from the find query { "_key" : "group:administrators:members" }
If you have rockmongo you may also just edit the result that you find from { "_key" : "group:administrators:members" } -
Np, Its nice to give back to the community
-
@Alexander-Anderson your are right, updates:
show collections
db.objects.find( { "_key" : "username:uid" } )
db.objects.find( { "_key" : "group:administrators:members" } )
db.objects.update( { "_id" : ObjectId("54022b7f60757d4944a05931") }, { "_key" : "group:administrators:members", "value" : [ "1", "2", "3" ] }, { upsert: true })