Forgot All Credentials

Hello I am running Ghost 1.21.1 on Ubuntu 16.04 on Digital Ocean. I forgot the admin email address and password (I think I used a throwaway) and I had password protected the page and forgot that password. I still have access to the Digital Ocean droplet but I can’t seem to disable any of these settings. Any suggestions on how I can get the content or disable the password protection from the server level?

http://www.farmsoftstudios.com/blog/2014/01/web-applications/resetting-your-ghost-blog-password/

Have you tried Google or Bing or DuckDuckGo?

Thanks @andy1247008998 but I don’t see any ghost.db file under ‘/var/www/ghost/current/content/data’ (I also checked ‘/var/www/ghost/versions/1.21.1/content/data’), only a README.md. And I know there is data in the Ghost blog.

I also don’t have the mysql database password so I can’t export the data out of mysql either…

Your db password is in config.production.json.

Hey there!

You’re going to have to look into your database for the information you’re looking for, but it shouldn’t be too difficult!

In your terminal,

cd into your ghost installation directory.

run ghost config get database.client - it will either output sqlite3 or mysql

If it says sqlite3, you can find the database by running ghost config get database.connection.filename

With sqlite3, you can try to use the terminal to find the data you want, but I personally would download the database using sftp or your favorite file retrieval method and use an sqlite browser to find the data you want. I use https://sqlitebrowser.org/

If it says mysql, you can find the database config by running

ghost config get database.connection.host for the host
ghost config get database.connection.user for the username
ghost config get database.connection.password for the password
ghost config get database.connection.databse for the database

With those details, you can get into mysql by running mysql -u {username} -p{password} {database} (assuming the host is localhost)

Run SELECT value FROM settings WHERE key='password'; to get the password for the frontend of your site. For sqlite, switch to the Browse Data tab and choose settings from the dropdown. Use the filter input field under key and search for password. Your password will be under the value row

Run SELECT email FROM users; to get the list of email addresses registered with ghost. For sqlite, use the users table and browse the email column. Once you have the email, you can reset your password from the frontend, which should get you access to your blog!

Let me know if you want me to go more in depth about anything!

p.s. you don’t have to use ghost config ..., but I personally advise people to use it to prevent any unintended consequences

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.