Reset user password in your own Ghost Blog

I’ve started testing new Ghost blogging platform for a while on a virtual machine before I take decision about switching to it (or maybe won’t)… After few days, I wanted to go forward with more testing and stuck on “e-mail and password” login prompt 🙂
I’ve started looking into files and found ghost_dir/content/data/ghost-dev.db SQLite database. It can be opened like that:

sqlite3 content/data/ghost-dev.db

Then you could see whats your mail (and other info):

sqlite> select * from users

Now password – after searching a little I found: ghost_dir/core/server/models/user.js file. There is a tip in it:

// Hash the provided password with bcrypt
return nodefn.call(bcrypt.hash, _user.password, null, null);

So I used this site: http://bcrypthashgenerator.apphb.com/ to generate bcrypt hash and updated it in DB:

sqlite> update users set password="$2a$10$f29LDrB8S1JMfdF40Vmf1.h2OyhtlcefaMrFQVpHeX9XQ7Xiq17KC" where id = 1;
sqlite> .quit

Additionally as suggested by henshao: if the account has been locked, you can set status to active to unlock the account, like that:

update users set status = “active”;

Now try to log with updated credentials.
P.S. I strongly suggest to change password after successful login.

8 thoughts on “Reset user password in your own Ghost Blog”

  1. Thank you! In addition, if the account has been locked, you can set status to active to unlock the account.

    update users set status = “active”;

    1. I tried this because my accout went locked, but says that couldnt find “active” column, I tried then changing the word to “unlocked” seems to worked but now when I try to open blog.domain/ghost it takes me to the setup/one page and ask me to create an account and a new blog. Blog.domain is still accesible

    2. Ghost was updated few times after I write this. I don’t have Ghost running anywhere so I can’t help you with this. Let me know if you find solution.

Leave a Reply

Your email address will not be published. Required fields are marked *