reset user password in self-hosted Ghost Blog

A little tip from the file ghost_dir/core/server/models/user.js:

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

Generate bcrypt hash and updated it in content/data/.

Or just use this hash which is for “password”: $2a$10$f29LDrB8S1JMfdF40Vmf1.h2OyhtlcefaMrFQVpHeX9XQ7Xiq17KC

In bash, run this command to drop into an sqlite shell:

sqlite3 ghost.db  

Then issue the series of commands to reset your user password:

sqlite> UPDATE users SET password="$2a$10$f29LDrB8S1JMfdF40Vmf1.h2OyhtlcefaMrFQVpHeX9XQ7Xiq17KC" where id = 1;  

or replace WHERE id =1 with email = <<YOUR_EMAIL_ADDRESS>>

And then quit.

sqlite> .quit  

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.

References:


View or Post Comments