Problem securing node-red password on ubunto

543 views
Skip to first unread message

Luis GCU

unread,
May 5, 2017, 9:29:39 PM5/5/17
to Node-RED
I'll  appreciate any good soul that can provide me a hint where reside a problem that Node-red password  is not working on my laptop running ubuntu, I use the password setting on raspberry pi and it work fine.
 
on my  first try  what I  did to enable the credential on settings.js like below 

$ sudo nano ~/.node-red/settings.js

// property can be used. See http://nodered.org/docs/security.html for details. adminAuth: { type: "credentials", users: [{ username: "admin", password: "$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.", //password=password permissions: "*" }] },
then restart node-red: sudo systemctl restart node-red
when accessing node red localhost:1770 authentication popup appear, after entering the credentials "admin" & "password"
it just hang there and after a few minutes it read as failed.. if i put wrong password or user name, it quickly read as failed



I also tried to hash new password but that do not change the previous described behavior.

node-red-admin hash-pw

Thanks if anyone may have clue what i  am missing.

Luis GCU

unread,
May 5, 2017, 10:51:58 PM5/5/17
to Node-RED
hello guys , every time   I tried to install new node I got the following message.. is that warning  some how related to the problem that I have that the credentials do not work?


npm WARN bcry...@1.0.0 No description
npm WARN bcry...@1.0.0 No repository field.


////////////////////

bcry...@1.0.0 /home/angel/.node-red
└─┬ node-red-contrib...@0.1.15
  └─┬ body-...@1.17.1
    ├── by...@2.4.0
    ├── iconv...@0.4.15
    ├── q...@6.4.0
    └── raw-...@2.2.0

npm WARN bcry...@1.0.0 No description
npm WARN bcry...@1.0.0 No repository field.

Mark Setrem

unread,
May 6, 2017, 1:44:53 AM5/6/17
to Node-RED
No this isn't related, it's a warning not an error and from the example given the node is installed

Julian Knight

unread,
May 6, 2017, 9:53:11 AM5/6/17
to Node-RED
Any errors either in the Node-RED console or in the browser console?

Also, it isn't a good idea to use SUDO when you don't need to.- using sudo with ~/.node-red/settings.js might end up with the wrong permissions on that file or even use the wrong home folder (e.g root's rather than the users - I don't think it does but why take the chance)

Luis GCU

unread,
May 6, 2017, 12:18:18 PM5/6/17
to Node-RED

Thanks Julian,

I got this error on the console:

Potentially unhandled rejection [1] Error: EACCES: permission denied, open '/home/angel/.node-red/.sessions.json'  at Error (native)

could you please point me the right steps on how to solve that? kindly ask to provide me as much details as possible.. since I am not an expert using Linux.

thanks in advanced..

Luis GCU

unread,
May 6, 2017, 12:48:08 PM5/6/17
to Node-RED
well I guess I have found the problem.. thanks I read this post Unable to login to node-red after PM2 install and the resolution was just to change persmision on the .node-red folder 

sudo chown -R angel /home/angel/.node-red 
:)

Colin Law

unread,
May 6, 2017, 12:53:33 PM5/6/17
to node...@googlegroups.com
The problem may well have been as a result of using sudo earlier, as
Julian suggested. The chown command has restored all the files to
being owned by angel, undoing the harm done by using sudo nano ...

Colin
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/a7224e16-5651-4558-af05-17b6446b3102%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Julian Knight

unread,
May 6, 2017, 4:05:18 PM5/6/17
to Node-RED
Yes, inappropriate use of sudo and other permissions issues related to that seem to be some of the most common. It is a hard thing to get your head around, especially if you are not used to UNIX/Linux.
Reply all
Reply to author
Forward
0 new messages