How to reset Ghost password?
Ghost How To

How to reset Ghost password?

Mishel Shaji
Mishel Shaji

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".

$2b$10$5M2Zl3Y9xci2aG9QbpTtDubm8GOlRgu3t3Id8GUM3Bhe9q4GDP01m

Reset Ghost Password

To reset the password of your website:

  1. Login to the server using SSH.
  2. Connect to the MySQL database using mysql -u username -p. Enter the password if necessary. Replace username with the database username.
  3. Execute the following query to reset the password.
    UPDATE your_database_here.users SET password='hashed_password' WHERE email = 'login_email';
  4. Login as Ghost admin.
  5. 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: sqlite3 ghost.db
  • Type UPDATE users SET password='PASTE_HASH_HERE' WHERE email = 'YOUR_EMAIL_ADDRESS'
  • Type .exit to exit sqlite3
  • Log into your blog, and change your password to a stronger one.

For MySQL (Using phpMyAdmin)

If you have any Control Panel such as Plesk or CPanel installed on your server, you can, most probably reset the password using phpMyAdmin.

  • Login to the control panel and open databases.
  • Find and open the database of your website.
  • Select users table.
  • Double click on the password column. To edit it's value and paste the new hashed password there.
  • Navigate to https://yourblog.com/ghost and 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.