It can be frustrating if you forgot your Ghost admin password and Ghost cannot send you a recovery email. This can happen due to blocked ports or wrong email configuration on your server.
In this post, we will see how to reset the ghost admin password if you cannot receive a recovery email.
Creating Password Hash
Ghost does not store passwords as plain text. All passwords are encrypted using the BCrypt algorithm. Therefore we cannot change the password simply by updating the value in the passwords column of the database table.
Fortunately, we have a lot of free online BCrypt password hash generators in the web. One such website is passwordhashing.com. We can use this website to generate a new password hash for our Ghost blog.
To create a new BCrypt password hash, visit https://passwordhashing.com/BCrypt and type a new password. The website will generate the corresponding BCrypt password hash. Copy the generated hash.
You can also use the password hash shown below. It is the hash of "Lk@7y5@yQS".
Reset Ghost Password
To reset the password of your website:
- Login to the server using SSH.
- Connect to the MySQL database using
mysql -u username -p. Enter the password if necessary. Replace
usernamewith the database username.
- Execute the following query to reset the password.
UPDATE your_database_here.users SET password='hashed_password' WHERE email = 'login_email';
- Login as Ghost admin.
- Choose a new password and configure email backend. (optional)
Reset Password of Local Installation
You’ll need to reset the password in the SQLite DB by manually inserting a new hash into the DB.
- Get access to your DB from the console, or through a GUI tool such as DB Browser for SQLite if you have it.
- If you are using the console, CD to your ghost webroot, (the DB is under
content/data/) and then type:
UPDATE users SET password='PASTE_HASH_HERE' WHERE email = 'YOUR_EMAIL_ADDRESS'
.exitto exit sqlite3
- Log into your blog, and change your password to a stronger one.
For MySQL (Using phpMyAdmin)
- Login to the control panel and open databases.
- Find and open the database of your website.
- Double click on the password column. To edit it's value and paste the new hashed password there.
- Navigate to
https://yourblog.com/ghostand login with the new password.
You can also click on the SQL tab and execute the following query to update the password.
UPDATE users SET password='hased_password_here' WHERE email = 'your_login_email';
I hope you enjoyed this article. If you have any questions, let me know in the comments below.