RustDesk self-built server deployment and usage tutorial

RustDesk is a powerful open source remote desktop software, the work of Chinese developers . It is built using the Rust programming language to provide a safe, efficient, cross-platform remote access experience. It can be said to be the most popular open source remote desktop software in the world, and the number of GitHub stars has reached an astonishing 64k!

与 TeamViewer、ToDesk 等专有远程访问解决方案相比,RustDesk 作为一个开源软件,提供了几个显著的优势:

  1. RustDesk is completely free to use, with no hidden fees or subscription plans.
  2. Due to its open source nature, RustDesk's code is transparent and can be audited by the community, providing greater security and trustworthiness.
  3. RustDesk is developed using the Rust language, which fundamentally ensures the memory safety and high performance of the program.

However, now there is bad news: due to frequent use by fraudsters, the project has now suspended domestic services.

Author's original words:

In order to further respond to fraud, we have temporarily decided to stop services in China. If users now access domestic hosts through public servers, they will receive a banned message.

There is also a warning message on the homepage of the official website:

The author published an announcement on Open Source China , mainly because fraudsters used SMS links to get the elderly to download the App, and then implemented command and control of mobile banking . The victims were defrauded of huge amounts, causing great damage to their families.

In order to further respond to fraud, they have temporarily decided to stop services in China. If users now access domestic hosts through public servers, they will receive a banned message .

I can only say that I am helpless.

Fortunately, a key feature of RustDesk is that it allows users to build their own servers , thereby gaining more control and privacy protection when using RustDesk. The so-called self-built server refers to self-built ID Server and Relay Server. As for what ID Server and Relay Server are, below we will give you a detailed introduction and provide a step-by-step guide to help you set up your own ID Server and Relay Server.

RustDesk Architecture Overview

To understand the importance of building your own server, you first need to have a comprehensive understanding of RustDesk's architecture. RustDesk uses the classic client-server model, which involves three main components: RustDesk client, RustDesk server, and ID Server.

  1. client-server model

    In RustDesk's architecture, the client is an application running on the user's device (such as a laptop, tablet, or smartphone). It provides a graphical interface that allows users to initiate remote access requests and interact with remote computers. The server component, on the other hand, runs on the target computer that is to be accessed remotely. It is responsible for listening for connection requests from the client and sending screen updates to the client and receiving input events after the connection is established.

  2. Role of ID Server

    ID Server plays an important role in the RustDesk ecosystem. Its main responsibility is to facilitate the initial connection establishment between the client and the server. When the RustDesk server starts, it connects to the ID Server and registers itself, providing information such as the server ID and public IP address . Similarly, when a client wants to connect to a specific RustDesk server, it queries the ID Server for the target server's connection information.

    The ID Server maintains a directory of registered RustDesk servers and acts as an intermediary between clients and servers, helping them establish direct peer-to-peer (P2P) connections . Once the client obtains the server's connection information from the ID Server, it can attempt to connect directly to the server without further relaying data through the ID Server.

  3. The role of Relay Server

    In some network environments, the RustDesk client and server may not be able to establish a P2P connection directly , such as when they are behind a NAT (Network Address Translation) or firewall. To overcome this challenge, RustDesk introduced Relay Server.

    If the client cannot connect directly to the server, it requests a Relay Server from the ID Server. Then, both the client and the server connect to the designated Relay Server and relay all network traffic through it . Relay Server in this case acts as a bridge between client and server, forwarding packets from one party to the other.

    It is worth noting that even when communicating through a Relay Server, RustDesk maintains end-to-end encryption to ensure that the relay server cannot access plaintext data. Relay Server just blindly forwards encrypted data packets without being able to view or modify their contents.

Self-built server

RustDesk ID Server and Relay Server currently support multiple deployment methods. They can be deployed directly using binaries in Linux and Windows, or deployed using Docker. For details, please refer to RustDesk's official documentation .

If you don't want to bother, or don't know anything about Docker, it doesn't matter. The Sealos app store provides one-click deployment application templates, and the deployment can be completed with one click of the mouse, which is very smooth.

Since RustDesk is written in Rust, it is very efficient and has strong concurrency. After actual testing, the 1C1G configuration can be used by an entire small team . Sealos' application template defaults to a minimum configuration of 0.2C128M, which is completely sufficient for personal use . If you need to use it for multiple people, you can adjust the configuration at any time, because Sealos is pay-as-you-go. You can adjust it however you want, whenever you want, which is very refreshing.

Let’s take a look at the prices that everyone is more concerned about:

The default minimum configuration only costs 0.12 yuan per day, and we can save even more money based on the pay-as-you-go mechanism. The so-called pay-as-you-go means you pay for what you use. The "how much you use" here refers to how much CPU, memory, storage and other resources you use. So if I pause it when not in use and start it again when in use, I only have to pay for it every day. It costs 0.01 yuan (because the CPU and memory are not occupied in the paused state, only storage is occupied).

If you are using it as a whole team and don’t want to pause and start it frequently, you can also save money through other methods, such as setting up a scheduled task, starting it during the day and pausing it at night , which can save half of the money.

Including the cost of the external network port, the daily cost is expected to be between 0.1 and 0.2 yuan .

Okay, after talking about the price, if you are tempted or think you can give it a try, then continue reading the tutorial.

Open the RustDesk application template directly , and then click "Go to Sealos Deployment" in the upper right corner.

If this is your first time using Sealos , you need to register and log in to a Sealos public cloud account. After logging in, you will immediately jump to the template deployment page.

After jumping in, you will see a variable ENCRYPTED_ONLY, you can choose 1 or 0. For the sake of privacy and security, it is strongly recommended to choose 1, which turns on forced encryption and only allows the establishment of encrypted connections, making it less likely to be used by others .

After the settings are completed, click "Deploy Application" in the upper right corner to start deployment. After the deployment is completed, directly click "Details" of the application to enter the application details page.

Click the "Log" button to view the log:

Two key pieces of information can be found in the log: external domain name and public key . It will be needed later.

Find RustDesk in "App Store" -> "My Apps" and click on it:

Find the external network ports mapped to port 21116 and port 21117 in Others respectively. 21116 is the port of the ID Server and 21117 is the port of the Relay Server. For example, the external network port of my ID Server is 30032, and the external network port of the Relay Server is 30325.

Client settings

Install RustDesk on the controlling and controlled computers respectively. Download address: https://rustdesk.com/zh/

After the installation is complete, open RustDesk and click on the three dots above to enter the configuration:

Find the network configuration:

Unlock the network settings first, then enter yours in the ID server <外网域名>:<ID Server 外网端口>, yours in the relay server <外网域名>:<Relay Server 外网端口>, and your public key in Key.

For example, the ID server here is brffleiu.bja.sealos.run:30032, the relay server is brffleiu.bja.sealos.run:30325, and the Key is LNS+q8OA02k7CH+TbzO1EzikNYsFS52YiMNi3pmz56k=.

Finally click "Apply" and that's it.

⚠️ Note: Both the controlling terminal and the controlled terminal must use the same ID server, relay server and Key to enable normal remote control.

Summarize

This article explores in depth the architecture of RustDesk, the benefits of building your own RustDesk server (ID Server and Relay Server), and the specific self-building steps. Although it requires a little extra work, it reaps many benefits, such as security and privacy.

As remote working and collaboration become more common, having a secure, efficient, and flexible remote access solution becomes critical. By building your own RustDesk ID Server and Relay Server, you can get a solution tailored to meet your unique needs.

RustDesk suspends domestic services due to rampant fraud Apple releases M4 chip Taobao (taobao.com) restarts web version optimization work High school students create their own open source programming language as a coming-of-age gift - Netizens' critical comments: Relying on the defense Yunfeng resigned from Alibaba, and plans to produce in the future The destination for independent game programmers on the Windows platform . Visual Studio Code 1.89 releases Java 17. It is the most commonly used Java LTS version. Windows 10 has a market share of 70%, and Windows 11 continues to decline. Open Source Daily | Google supports Hongmeng to take over; open source Rabbit R1; Docker supports Android phones; Microsoft’s anxiety and ambitions; Haier Electric has shut down the open platform
{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/4148359/blog/11105894