1:软件介绍:
名称 | 作用 | 官网 | 项目地址 |
---|---|---|---|
rustdesk | 实现多端互控 | https://rustdesk.com/index.html | https://github.com/rustdesk/rustdesk |
2:安装
1. 服务器端
- 安装,启动docker
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl start docker
#systemctl enable docker #开机自启
- 下载镜像
sudo docker image pull rustdesk/rustdesk-server
- 启动服务
sudo docker run --name hbbs -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v `pwd`:/root -td --net=host rustdesk/rustdesk-server hbbs -r <relay-server-ip[:port]>
sudo docker run --name hbbr -p 21117:21117 -p 21119:21119 -v `pwd`:/root -td --net=host rustdesk/rustdesk-server hbbr
说明:
1:
-v `pwd`:/root # `pwd`挂载目录(服务器上有的目录)
2:
hbbs -r <relay-server-ip[:port]>
# relay-server-ip:服务器ip
# port:hbbr服务暴露的端口
4: 参考启动命令
docker run --name hbbs -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v /home/jiang:/root -td --net=host rustdesk/rustdesk-server hbbs -r 127.0.0.1:21117
docker run --name hbbr -p 21117:21117 -p 21119:21119 -v /home/jiang/jiang:/root -td --net=host rustdesk/rustdesk-server hbbr
top:别忘了开端口
2. 客户端
去项目地址下载对应的安装包进行安装。
3:配置
window端:
设置 -> 网络
id服务器:服务器ip
key:挂载目录底下的.pub文件 ,使用cat查看复制
5:其他
1:rustdesk 官方Docker Compose
version: '3'
networks:
rustdesk-net:
external: false
services:
hbbs:
container_name: hbbs
ports:
- 21115:21115
- <hbbs_port>:21116 # 自定义 hbbs 映射端口
- <hbbs_port>:21116/udp # 自定义 hbbs 映射端口
image: rustdesk/rustdesk-server
command: hbbs -r <your_domain>:<hbbr_port> # 填入个人域名或 IP + hbbr 暴露端口
volumes:
- <mount_path>:/root # 自定义挂载目录
networks:
- rustdesk-net
depends_on:
- hbbr
restart: unless-stopped
deploy:
resources:
limits:
memory: 64M
hbbr:
container_name: hbbr
ports:
- <hbbr_port>:21117 # 自定义 hbbr 映射端口
image: rustdesk/rustdesk-server
command: hbbr
volumes:
- <mount_path>:/root # 自定义挂载目录
networks:
- rustdesk-net
restart: unless-stopped
deploy:
resources:
limits:
memory: 64M