0
votes

I know you can create new admin users via PUT $HOST/_config/admins/username -d '"password"'.

However, what if I have an existing user from the _users database and I want to add it to the admin party?

The main problem here is that I don't know that user's password.

Thanks in advance, Andres

1

1 Answers

0
votes

Since the documents in the _users database contain password hash fields (derived_key, password_scheme, salt, password_sha, iterations) the hashes can be reused to create an admin using the raw=true parameter.

The hashed admin password format for PBKDF2 is as seen in the source code:

-pbkdf2-derivedkey,salt,iterations

For the SHA1 it is not quite clear which one is the hash and which one is the salt. Just try.

Note that the admin hashes are not stored in the _users database for a reason and reusing a password that was once exposed in this manner for an admin might be a bad idea security-wise.