Unlock your ghost blog and reset your forgotten password

Ghost blogging platform

I haven't added a post on my blog in quite a while and I was unfortunate enough to have forgotten my password. I have a Ghost install on a Digital Ocean droplet.

I have to admit that I was too lazy to go through the email setup process. After 4 failed trials the only option was to get a reset via email and since that was never taken care of I was out of luck. I was fortunate to run into two articles that saved my life.

  1. Unlock your locked ghost account
  2. Resetting your ghost blog password

The following steps are a combination of the ones shared on those found in the articles above

Install SQLite 3

Login to your DO droplet via ssh

ssh root@<<your ip address>>  

then update apt-get

sudo apt-get update  

Now install sqlite3

sudo apt-get install sqlite3  

If everything went well let's move on to the next step

Reactivate your account

Now navigate to your Ghost data folder

cd /var/www/ghost/content/data && ls  

you should see at least two files listed

ghost.db README.md  

Open the ghost.db file via the sqlite3 console

sudo sqlite3 ghost.db  

At the prompt check for the users list

sqlite> select * from users;  

You should normally see a long line containing all your user's info. If you look closely you will find the value 'locked' on that line. So let's update that to active

sqlite> update users set status = "active";  

Check again if successful the status should have change from 'locked' to 'active'

sqlite> select * from users;  

At this point you have access to your site again, if you do remember your old password go to your admin url and login again. Don't forget to exit your sql prompt

sql> .exit  

If you happen to have completely lost your old password like I did then go on to the next step

Reset your password

Ghost uses a bcrypt hash, so you will need to create a password then encrypt it before updating your user. The tool suggested in the Farmsoft Studios article will do the trick:
bcrypt hash generator.

Create your password and copy the hashed string. Now return to your terminal and run this command

sql> update users set password='<<paste_hash_here>>' where email='<<your_email_address>>'  

Voila!!! If all went well you should be able to go login again via the ghost admin url. You can know exit

sql> .exit  

and get back to blogging :)

Ady Ngom

Ady Ngom


Ady Ngom is a freelance web and mobile application developer who has a passion for well crafted interfaces. You might catch him humming a good tune while taking long walks with a camera in hands.

View Comments