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.

  1. Log in with your misskey user into postgres (assuming that’s what you’re running MissKey on).
  2. Connect to the database.
  3. select * from "user" where "isAdmin" = true;
  4. Grab the userId for the user you’re resetting the password for.
  5. select * from user_profile where "userId" = 'your-userId'; to confirm that you’re getting the right info.
  6. Get the hashed password with bcrypt, such as: python -c 'import bcrypt; print(bcrypt.hashpw("new-password", bcrypt.gensalt(log_rounds=10)))'
  7. UPDATE user_profile SET password = 'hashed-password' WHERE "userId" = 'your-userId';

Notes:

And… done.

Join the FSF.