# I cannot create a username and password

**URL:** https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324
**Category:** General
**Tags:** security
**Created:** [30 November 2023 21:28 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324 "2023-11-30T21:28:00Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![emrerdogan](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@emrerdogan](https://discourse.nodered.org/u/emrerdogan)
#### Post date: [30 November 2023 21:28 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/1 "2023-11-30T21:28:00Z")

</div>

I cannot create a username and password. I follow the instructions on the installation page, but I cannot get positive results.  
the problem command : settings.js  
node-red version: v3.1.0  
macOs

---

<div class="post-metadata">

### Author: ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)
#### Post date: [30 November 2023 21:40 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/2 "2023-11-30T21:40:58Z")

</div>

Hi,  
That's not how you should do it, it's described [here](https://nodered.org/docs/user-guide/runtime/securing-node-red#editor--admin-api-security)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 November 2023 21:48 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/3 "2023-11-30T21:48:39Z")

</div>

> [@emrerdogan](#):
>
> I follow the instructions on the installation page,

Which installation page?

---

<div class="post-metadata">

### Author: ![eerke2021](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eerke2021/32/83528_2.png) [@eerke2021](https://discourse.nodered.org/u/eerke2021)
#### Post date: [1 December 2023 00:45 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/4 "2023-12-01T00:45:13Z")

</div>

I too can't. Resorted to just uncommenting the file:

```auto
    adminAuth: {
        type: "credentials",
         users: [{
            username: "admin",
            password: "$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.",
            permissions: "*"
        }]
    },

```

Still doesn't work even with default name and password. Where is the error in that code?

Edited to add: Checked command above has comma and if I recomment it works again. Log happy.

---

<div class="post-metadata">

### Author: ![eerke2021](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eerke2021/32/83528_2.png) [@eerke2021](https://discourse.nodered.org/u/eerke2021)
#### Post date: [1 December 2023 00:56 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/5 "2023-12-01T00:56:55Z")

</div>

![Screenshot 2023-12-01 005616](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/a/3addf45778e37ad305cf381062019c763816b399.png)  
Every time:

Edited to add: Coloured squares making an X are a password manager I've checked it is not autofilling nonsense

2nd edit: Tried Firefox and Edge browsers

3rd edit: Not hashing password

---

<div class="post-metadata">

### Author: ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)
#### Post date: [1 December 2023 08:26 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/6 "2023-12-01T08:26:39Z")

</div>

Hi,  
To create a hashed password, run

```bash
node-red admin hash-pw

```

Then enter your password and the result is a hashed code.

With this hashed code go to the `settings` file and replace the password line with the code.

In the editor you must use de password not the hash to login.

---

<div class="post-metadata">

### Author: ![eerke2021](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eerke2021/32/83528_2.png) [@eerke2021](https://discourse.nodered.org/u/eerke2021)
#### Post date: [1 December 2023 12:19 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/7 "2023-12-01T12:19:09Z")

</div>

I'm not at the hashing stage yet. I can't get even an unhashed code to work even if I just uncomment that paragraph.

---

<div class="post-metadata">

### Author: ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)
#### Post date: [1 December 2023 12:26 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/8 "2023-12-01T12:26:23Z")

</div>

Because when you enter a password in the editor it is hashed to compare it to the one defined in the settings.

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [1 December 2023 12:32 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/9 "2023-12-01T12:32:34Z")

</div>

> [@eerke2021](#):
>
> I can't get even an unhashed

Password needs to be hashed.

1. Generate the hash for your password
2. Set the hash in `settings.js`
3. Restart Node RED
4. log on with the **un-hashed** version

---

<div class="post-metadata">

### Author: ![eerke2021](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eerke2021/32/83528_2.png) [@eerke2021](https://discourse.nodered.org/u/eerke2021)
#### Post date: [1 December 2023 12:53 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/10 "2023-12-01T12:53:05Z")

</div>

thanks. I was going step by step. Thought plain text first. When you say:  
node-red admin hash-pw  
Is this in terminal?  
I need to find how to access a terminal on my device.

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [1 December 2023 12:55 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/11 "2023-12-01T12:55:01Z")

</div>

> [@eerke2021](#):
>
> Is this in terminal?

Yes, or use a web based generator.  
[Bcrypt-Generator.com - Generate, Check, Hash, Decode Bcrypt Strings](https://bcrypt-generator.com/)

The hash algorithm is **BCrypt** - just be mindful about using external tools, whilst mostly fine to use, feel I should offer that caution.

---

<div class="post-metadata">

### Author: ![eerke2021](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eerke2021/32/83528_2.png) [@eerke2021](https://discourse.nodered.org/u/eerke2021)
#### Post date: [1 December 2023 14:16 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/12 "2023-12-01T14:16:15Z")

</div>

thanks! I just have missed the bit where I needed to insert the hashed version of the password. I was using a 20 digit password manager derived password so it looked like that anyway.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [30 January 2024 14:16 UTC](https://discourse.nodered.org/t/i-cannot-create-a-username-and-password/83324/13 "2024-01-30T14:16:23Z")

</div>

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