Preface

Milesight provides technical assistance only for devices operating under standard firmware and root password settings. Any changes under root permissions, including but not limited to development or modifications to the device's firmware, are not supported by Milesight technical support team.
By the changes under root permissions of your device, please acknowledge and accept the following:
1. Loss of Support: Our technical support team will not provide any guidance, troubleshooting, support or RMA for devices with modified under root permissions.
2. Operational Risks: Development or modifications under root permissions can affect the normal operation, stability, and security of your device. You assume all risks associated with such modifications.
3. Responsibility: You are solely responsible for any issues, damages, or data loss that may result from changing the root permissions of your device.
 


Description

This node-red example provides the solution to change the root password of Milesight gateway. After change, you can log in the root account to execute more commands as required.



Requirement

  • Milesight Gateway: UG56/UG65/UG67

 

Configuration

Step 1: Launch Node-RED and Import Flow Example

1. Go to App > Node-RED page to enable Node-RED program and wait for a while to load the program, click Launch button to start Node-RED web GUI.

 

2. Log in the Node-RED web GUI. The account information is the same as gateway web GUI. 

 

3. Click Import to import the node-red flow example by pasting the content or import the json format file at the end of article.

 

Step 2: Node-RED Configuration

Flow structure:

Content:

[{"id":"b6310f24ba10bc17","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"7adfeb234a913e07","type":"inject","z":"b6310f24ba10bc17","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":260,"wires":[["8f0ad4447ebe0170"]]},{"id":"8f0ad4447ebe0170","type":"exec","z":"b6310f24ba10bc17","command":"echo -e \"123456\\n123456\" | passwd","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":590,"y":260,"wires":[[],[],[]]},{"id":"2b1443f7f7be0b38","type":"comment","z":"b6310f24ba10bc17","name":"Replace \"123456\" as any password you need to change","info":"","x":560,"y":160,"wires":[]}]


Node 2: exec node

Change the command according to your password setting. If you need to change password as “123456”, the command is “echo -e "123456\n123456" | passwd”.

 

 

Step 3: Deploy and Check Result

1. Click Deploy to save all node-red configurations.

 

2. Click timestamp node to execute the command to change password.

3. Enable SSH service or connect the USB of gateway to PC, open Putty or other SSH tool and log in the CLI of gateway via root account.



------END-----