phil@bajsicki:~$
MissKey: Resetting Admin Password
So recently I had the need to reset the admin password in MissKey.
Alas, there was no recovery email configured, nor other users on the instance, so I needed to do some digging in the database.
So here is the short of it.
- Log in with your misskey user into postgres (assuming that’s what you’re running MissKey on).
- Connect to the database.
select * from "user" where "isAdmin" = true;
- Grab the
userId
for the user you’re resetting the password for. select * from user_profile where "userId" = 'your-userId';
to confirm that you’re getting the right info.- Get the hashed password with
bcrypt
, such as:python -c 'import bcrypt; print(bcrypt.hashpw("new-password", bcrypt.gensalt(log_rounds=10)))'
UPDATE user_profile SET password = 'hashed-password' WHERE "userId" = 'your-userId';
Notes:
- Step 6 requires that you have python-bcrypt installed, and uses that library to do its thing.
- There is a difference between single quotes, double quotes, and lowercase/ capitals. This is a quirk of psql, so make sure you get those right.
And… done.