Hello everyone, hoping that you are all very well, I wanted to enter a password myself to node red by the "Username/password based authentication " and then enter them in node-red it throws me “Login failed”.
To create the password in bcrypt format I am using this website “BCrypt | Password Hashing ”
Greetings and thanks.
rko
27 August 2021 18:13
2
I wouldn't share a password with a 3rd party. Did you see the instructions here .
Thanks for the answer, yes, I have seen the instructions but I have no results.
I have put the 3 commands and nothing happens.
You can see that in this screenshot.
I have Node-Red installed on an Onion Omega controller and that's why it's hard for me to find documentation.
Thanks in advance and greetings.
rko
27 August 2021 18:32
4
I think node-red admin hash-pw
only works with recent versions. What version are you using?
Alternative:
bcrypt
seems to be missing, try:
npm install -g bcrypt
and then
node -e "console.log(require('bcrypt').hashSync(process.argv[1], 8));" your password
then copy the hash to the settings.js file in the adminAuth section.
and then clear the terminal history
history -c
Also you need to restart Node-RED after this.
I can´t install bcrypt
I have v1.2.9 of Node-Red
Thanks in advance and greetings.
rko
27 August 2021 18:56
6
Just checked, the first command node-red admin hash-pw
should work with your Node-RED version.
Maybe the path to node-red
is not known. Do you know the location?
I am not very clear about the location but I know that I can enter the settings.js file with this address:
vi /root/.node-red/settings.js
rko
27 August 2021 19:01
8
Unfortunately, I don't know the mentioned controller. How do you start/restart Node-RED usually?
Hello, @fsaavedra and welcome to the community.
I don't know anything about the issue you're having but I see that npm is telling you that your node.js it too old. Version 16 is current but I don't think you can use it with NR v 1.x. I suggest you update your node package to v12 or maybe v14 and try again.
Whilst the advice from @LosinIt is well intentioned, it is not the cause of the issue here.
The node-red admin hash-pw
command will work once you identify where exactly the node-red
command it.
To figure that out, the question is as @rko asked - how do you start Node-RED?
Hi everyone and thanks!!
Nodered I start it from a web ui that provides a device called IoT Edge computer from NCD.io , I am really interested in solving this problem and I have read a lot but I have not found the solution
On the top of image you can see Node-Red.
Thanks.
rko
28 August 2021 02:51
12
Can you show us the Node RED
tab. Maybe there are hints there.
Here I show you some screenshots that are from: Web UI - Nodered - Shell in a box.
Greetings!
As Nick said earlier...
The node-red admin hash-pw command will work once you identify where exactly the node-red command is
Try linux find..
find . -name node-red
Also, what does npm root -g
tell you?
Once you find the path to node-red, then you can cd
to it's path.
This shows me the commands that I enter
Try running node /usr/lib/node_modules/node-red/red.js admin hash-pw
Thanks for the support, I managed to enter the command and then enter a password, then copy that password in the settings.js.
But after trying to enter with the entered password, it tells me an error.
I repeated the procedure 3 times
.
Greetings!
rko
28 August 2021 14:53
18
Did you restart Node-RED after you changed the settings.js file?
Yes, I restart the device and I can verify that Node-red restarted because the display to enter user appears.( before it was commented)
rko
28 August 2021 15:41
20
Can you try a very simple password like 123 first? I saw that your terminal is an emulation in the browser - maybe some special signs are not translated correctly.
Or just type the password in the browser terminal to verify it's the expected password.