Stop Node-Red
sudo systemctl disable nodered.service
node-red-stop
sudo reboot & exit
Generating new SSH keys
cd .node-red
(cd /home/pi/.node-red or cd ~/.node-red)openssl genrsa -out privatekey.pem 1024
openssl req -new -key privatekey.pem -out private-csr.pem
openssl x509 -req -days 365 -in private-csr.pem -signkey privatekey.pem -out certificate.pem
ls -all
and you find 3 new files:- certificate.pem
- private-csr.pem
- privatekey.pem
Update settings.js
nano settings.js
- uncomment lines:
- var fs=required("fs");
- https: {
- key: fs.readFileSunc('/home/pi/.node-red/privatekey.pem')
- cert: fs.readFileSunc('/home/pi/.node-red/certificate.pem')
- },
- adminAuth: {
- type: "credentials",
- users: [{
- Username: "admin",
- password: " --- ",
- permissions: "*"
- }]
- },
- save & exit settings.js
Install node-red-admin
su
(to log as root)npm install -g node-red-admin
exit
pwd
cd .node-red
node-red-admin hash-pw
Start Node-red
sudo systemctl enable nodered.service
node-red-start
and login with admin and your password.
No comments:
Post a Comment