自建RustDesk远程桌面中继服务,TeamViewer、向日葵替代品

如果是自己使用的话frp内网穿透+rdp/vnc远程其实也是比较好用的,远程服务的话也可以试一下rustdesk,中继端也已经开源了,可以自己搭建一个玩一玩。https://github.com/rustdesk/rustdesk

1、自己构建:

#安装依赖
#Ubuntu 18 (Debian 10)
apt install -y g++ gcc git curl wget nasm yasm libgtk-3-dev clang libxcb-randr0-dev libxdo-dev libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libpulse-dev cmake curl zip unzip tar

#Fedora 28 (CentOS 8)
yum -y install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libxdo-devel libXfixes-devel pulseaudio-libs-devel cmake alsa-lib-devel curl zip unzip tar

#Arch (Manjaro)
pacman -Syu --needed unzip git cmake gcc curl wget yasm nasm zip make pkg-config clang gtk3 xdotool libxcb libxfixes alsa-lib pulseaudio curl zip unzip tar


pip3 install pynput

#安装vcpkg
git clone https://github.com/microsoft/vcpkg 
cd vcpkg
git checkout 2021.12.01
cd ..
vcpkg/bootstrap-vcpkg.sh
export VCPKG_ROOT=$HOME/vcpkg
vcpkg/vcpkg install libvpx libyuv opus

#构建
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
git clone https://github.com/rustdesk/rustdesk
cd rustdesk
mkdir -p target/debug
wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so
mv libsciter-gtk.so target/debug
VCPKG_ROOT=$HOME/vcpkg cargo run

2、自己构建可能相对比较啊麻烦,可以使用docker-compose。https://hub.docker.com/r/rustdesk/rustdesk-server/tags

mkdir rustdesk
cd rustdesk

vim docker-compose.yml

#添加以下内容

version: '3'

networks:
  rustdesk-net:
    external: false

services:
  hbbs:
    container_name: hbbs
    ports:
      - 21115:21115
      - 21116:21116
      - 21116:21116/udp
      - 21118:21118
    image: rustdesk/rustdesk-server:latest
    command: hbbs -r hbbs.example.com:21117   # hbbs.example.com改成
    volumes:
      - ./hbbs:/root
    networks:
      - rustdesk-net
    depends_on:
      - hbbr
    restart: unless-stopped

  hbbr:
    container_name: hbbr
    ports:
      - 21117:21117
      - 21119:21119
    image: rustdesk/rustdesk-server:latest
    command: hbbr
    volumes:
      - ./hbbr:/root
    networks:
      - rustdesk-net
    restart: unless-stopped

运行:

docker-compose up -d 

记得放行端口:

TCP(21115, 21116, 21117, 21118, 21119)
UDP(21116)

3、设置ID/中继服务器。

在 ID 服务器输入框中(被控端+主控端)输入 hbbs 主机或 ip 地址,另外两个地址可以不填,RustDesk会自动推导(如果没有特别设定),中继服务器指的是hbbr(21116)端口。

做为中继服务,宽带要求不是很高,国内小水管云服务器,问题应该也不是很大。如果TCP打洞直连失败,就要耗费中继流量。

留言

* - 必填