# Local install lost password

**URL:** <https://forum.ghost.org/t/local-install-lost-password/17536>\
**Category:** Developer help\
**Created:** [October 7, 2020, 8:44pm UTC](https://forum.ghost.org/t/local-install-lost-password/17536 "2020-10-07T20:44:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stoplion](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/stoplion/32/9834_2.png) [@stoplion](https://forum.ghost.org/u/stoplion)\
**Post date:** [October 7, 2020, 8:44pm UTC](https://forum.ghost.org/t/local-install-lost-password/17536/1 "2020-10-07T20:44:47Z")

</div>

I’ve came across this.

> [@Lost password on local install with no mail config](https://forum.ghost.org/t/lost-password-on-local-install-with-no-mail-config/3496):
>
> welp… I lost my password on my localhost installation of ghost2. and I can’t remember it. surely, I wanna reset it somehow. when I click to retrieve it via email I get this warning: Failed to send email. Reason: connect ETIMEDOUT 108.177.126.27:25.

```auto
require('/path/to/ghost/core/server/lib/security/password')
  .hash(process.argv[2])
  .then(console.log);

```

I’m trying to replace `core/server/lib/security/password`

**I’m not seeing `core/server/lib/security/password`?**

Where is this file?  
I have DB Browser for SQLite running locally.  
I’ve bcrypted a new password and I’ve updated it. But it does not work.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/c/c6479547a3645fb0dc1ffecb295e948c9d4bbb18.png)

There is an unknown error.

**Is there a local log?**

The `unknown error` is not very helpful.  
For example in frameworks like Rails, you get a print out of log data that you can use to debug locally.  
Is there any similar available in `ghost cli`?

Is there ANY tooling available locally to help? A `ghost console` to add new Users, Posts etc… Or some kind of log tailing ability?

---

<div class="post-metadata">

**Author:** ![daniellockyer](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/daniellockyer/32/11993_2.png) [@daniellockyer](https://forum.ghost.org/u/daniellockyer)\
**Post date:** [October 7, 2020, 8:59pm UTC](https://forum.ghost.org/t/local-install-lost-password/17536/2 "2020-10-07T20:59:18Z")

</div>

Hey @stoplion! 👋

That file was extracted to the `@tryghost/security` package, as you can see here: [Utils/password.js at main · TryGhost/Utils · GitHub](https://github.com/TryGhost/Ghost-Utils/blob/master/packages/security/lib/password.js) 🙂

---

<div class="post-metadata">

**Author:** ![egg](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/egg/32/1691_2.png) [@egg](https://forum.ghost.org/u/egg)\
**Post date:** [October 8, 2020, 9:29am UTC](https://forum.ghost.org/t/local-install-lost-password/17536/3 "2020-10-08T09:29:56Z")

</div>

We also have logging built into Ghost, and the Ghost-CLI docs for it are here: [https://ghost.org/docs/api/v3/ghost-cli/log/](https://ghost.org/docs/api/v3/ghost-cli/log/)

---

<div class="post-metadata">

**Author:** ![t1-tracey](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/t1-tracey/32/1682_2.png) [@t1-tracey](https://forum.ghost.org/u/t1-tracey)\
**Post date:** [April 24, 2022, 6:06am UTC](https://forum.ghost.org/t/local-install-lost-password/17536/4 "2022-04-24T06:06:21Z")

</div>

Mostly posting for myself to remember 😂 Thanks a lot for all the help here and in the previous topic.

1. Copy this to a local file e.g. `password.js`  
[Utils/password.js at main · TryGhost/Utils · GitHub](https://github.com/TryGhost/Ghost-Utils/blob/master/packages/security/lib/password.js)

2. Install npm requirements

```auto
npm install bluebird
npm install bcrypt

```

1. Make `make-password.js` in the same directory as `password.js`

```auto
require('password')
  .hash(process.argv[2])
  .then(console.log);

```

1. Generate password hash

```auto
node make-password.js "<your-new-password>"

```

On ghost:  
From command line:

1. Log into mysql

```auto
mysql -u root -p

```

To see password hash:

```auto
SELECT * FROM users;

```

1. Update password hash

```sql
UPDATE users
  SET
    password = 'NEW_PASSWORD_HASH'
  WHERE id = 1;

```
