Remote service access
Remote service access includes remote connections that use the Secure Shell (SSH) protocol, remote file management that uses the SSH File Transfer Protocol (SFTP), and remote access to other network services that use the Transmission Control Protocol (TCP).
Link IoT Edge v1.8 and later includes the remote service access feature by default. You can also integrate this feature separately. For more information about how to integrate the feature, see the open source library on GitHub.
Remote connection and remote file management are based on SSH technology. This lets you remotely log on to a gateway device to control the device and manage files. The username and password are the credentials for the SSH service on the gateway or in the Docker image.
Preparations
- Log on to the IoT Edge console.
- Create an edge instance and publish the gateway. For more information, see Set up the environment.
- After the edge instance is created, on the Instance Details page for that instance, click the Gateway tab and enable the remote access feature.

- Log on to the gateway device and enable the SSH service. The default port is 22. For more information about how to enable the SSH service, see OpenSSH Server. Note If the port is changed, log on to the gateway over the local area network (LAN) and manually change the port field in /linkedge/gateway/build/config/remote_terminal.json to the new port. The gateway must also support access to the
127.0.0.1local loopback port.
Remote SSH terminal
- In the navigation pane on the left of the IoT Edge console, choose Edge Instances.
- Find the instance that you created and click View in the Actions column.
- On the Instance Details page, click the Gateway tab. In the row for the gateway, click Remote SSH Terminal in the Actions column.

- In the dialog box that appears, enter the username and password to remotely log on to the gateway, and then click OK.After the connection is successful, the remote console page appears.Important Remote logon to the gateway grants advanced permissions. You can update, delete, modify, and view information and files on the gateway device. Use these permissions with caution.

- (Optional) In the remote console, you can manage remote files.The remote file management feature lets you browse and create directories, and upload and download files. The following table describes the operations.
Operation Description Refresh Refreshes the remote file directory. Add Directory Click Add Directory. In the dialog box that appears, enter a Directory Name and click OK. This adds a new remote file directory. Note Directory Name supports Chinese characters, English letters, and digits. The name can be up to 64 bytes long.Upload File Click Upload File. In the dialog box that appears, click the upload button to upload a file. After the upload is successful, click OK. This uploads a local file to the remote file directory. Download Click Download to download a remote file to your local computer. Delete Click Delete to delete a remote file. Important Deleted remote files cannot be recovered. Proceed with caution.
Share a remote service
- On the Instance Details page, click the Gateway tab. In the row for the gateway, click Share Remote SSH Terminal in the Actions column.
- In the dialog box that appears, turn on the Remote Share switch.

- The Share Remote SSH Terminal dialog box displays a link and password for remote sharing. Click Copy Link and Password to share the remote service with others.Note
- The remote share is automatically disabled after 24 hours. After it is disabled, users cannot start new sessions. However, users who are already logged on can continue their sessions. To prevent logged-on users from using the remote service, turn off the Remote Access switch on the Gateway
- Click Reset Password to generate a new password. After you reset the password, others cannot use the old password to log on. However, users who are already logged on can continue their sessions until they log out.
- Users who receive the shared link can log on to the device and use the remote service as follows:
- Open the shared link in a browser and enter the shared password.
- Enter the device username and password provided by the person who shared the link.
- After you log on to the device, you can use the remote service.
Custom remote services
In the More Remote Services window, you can add custom remote services. There are two ways to add a custom service:
- Dynamically add a custom remote service
- On the Instance Details page, click the Gateway tab. In the row for the gateway, click More Remote Services in the Actions column.
- Below the Remote Service drop-down list, click Add.

- In the dialog box that appears, set the parameters, and then click OK.
Parameter Description Service Category Select the service category from the drop-down list based on the remote service type on the edge. Note If the service type is not SSH, SFTP, HTTP, or HTTPS, select Custom.Service Name Set the name for the remote service. The name can contain letters, digits, hyphens (-), underscores (_), at signs (@), periods (.), and colons (:). IP Address The IP address of the remote service. Port Number The port number of the remote service. Username Enter the username to remotely log on to the gateway. Password Enter the username and password for remote logon to the gateway. - (Optional) You can delete a custom remote service that you added.
In the More Remote Services dialog box, find the service that you want to delete in the Remote Service drop-down list. Click the
icon next to the service name. In the dialog box that appears, click OK to delete the service.
- Statically add a custom remote service
- Log on to your gateway device.
- Go to the /linkedge/gateway/build/config/remote_terminal.json file and add a custom remote service based on the template in the file. Important A remote service that is statically added on the edge gateway is displayed in the More Remote Services list on the Gateway tab of the Instance Details page in the console, but it cannot be deleted from this list.
The following is the sample template in the file.

icon next to the service name. In the dialog box that appears, click OK to delete the service.
