docker-compose自建RustDesk远程控制服务器

1,631次阅读
没有评论

所有操作均在root权限进行,需要先切换用户sudo -i

1、新建文件夹【/root/rustdesk_data】mkdir /root/rustdesk_data

2、进入文件夹cd /root/rustdesk_data

3、新建yml文件,并写入保存配置vi docker-compose.yml

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 rustdesk.example.com:21117
    volumes:
      - ./data:/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:
      - ./data:/root
    networks:
      - rustdesk-net
    restart: unless-stopped

注意:

①其中第16行【rustdesk.example.com】更改为本机centos服务器公网ip地址,或已正确解析并可访问的域名。

②设置云服务器网卡安全组放行相关端口。

③设置centos系统防火墙放行相关端口,或直接把墙关停。

12345678 #临时关停防火墙systemctl stop firewalld.service#永久关停防火墙systemctl disable firewalld.service#查看防火墙状态systemctl status firewalld.service

 

4、给yml文件开权限chmod 755 docker-compose.yml

5、执行下载镜像和启动docker容器docker-compose up -d

因为yml文件第15行和30行已经填写rustdesk官方的docker hub在线路径,所以执行时候会自动pull运行。

6、查看docker运行情况docker ps

7、把yml文件里改好的IP或域名,填写到使用端中【ID服务器】

docker-compose自建RustDesk远程控制服务器

—————————————————–

至此,测试远程控制使用应该已经没有问题了,即使centos重启,docker容器也会自启动。

但是,有一个风险点:如果其他人知道了该IP或域名部署了rustdesk服务器,那么他人也可以直接填写ID服务器,使用服务。

这样的话,流量就给别人白嫖了。

所以接下来,需要强制开启填写key才能连接服务器。

8、修改并保存第3步配置的yml文件【/root/rustdesk_data/docker-compose.yml】vi /root/rustdesk_data/docker-compose.yml

在16行和31行末尾加上【-k _ 】,以强制开启验证key,即:#第16行 command: hbbs -r rustdesk.example.com:21117 -k _ #第31行 command: hbbr -k _

注意16行填写自己的IP或域名

9、重新加载容器1 #进入容器文件夹 2 cd /root/rustdesk_data 3 4 #执行命令 5 docker-compose pull 6 docker-compose up -d

此时,重新测试用户端控制,没有填写KEY的情况下,会报错无法连上。

10、找到KEY,并复制出来

#进入容器文件夹里【data文件夹】
cd /root/rusrdesk_data/data

#显示文件,可以看到3个db文件,2个id文件
#如:db_v2.sqlite3  db_v2.sqlite3-shm  db_v2.sqlite3-wal id_ed25519  id_ed25519.pub
ls


#查看公钥文件【id_ed25519.pub】,如:aMXQFBM+NpRIDqh0KZ7CUAXuQFxHqykAn5Fm0YqSQKM= 10 cat ./id_ed25519.pub

11、把KEY粘贴到用户端

docker-compose自建RustDesk远程控制服务器

12、重启centos服务器reboot

 注意进行重启,否则可能即使填写KEY仍连不上。

————————————————————–

至此,已全部完成rustdesk远程控制服务器自建,可以快乐的玩耍

正文完
可以使用微信扫码关注公众号(ID:xzluomor)
post-qrcode
 0
评论(没有评论)

文心AIGC

2023 年 9 月
 123
45678910
11121314151617
18192021222324
252627282930  
文心AIGC
文心AIGC
人工智能ChatGPT,AIGC指利用人工智能技术来生成内容,其中包括文字、语音、代码、图像、视频、机器人动作等等。被认为是继PGC、UGC之后的新型内容创作方式。AIGC作为元宇宙的新方向,近几年迭代速度呈现指数级爆发,谷歌、Meta、百度等平台型巨头持续布局
文章搜索
热门文章
潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026

潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026

潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026 Jay 2025-12-22 09...
面向「空天具身智能」,北航团队提出星座规划新基准丨NeurIPS’25

面向「空天具身智能」,北航团队提出星座规划新基准丨NeurIPS’25

面向「空天具身智能」,北航团队提出星座规划新基准丨NeurIPS’25 鹭羽 2025-12-13 22:37...
商汤Seko2.0重磅发布,合作短剧登顶抖音AI短剧榜No.1

商汤Seko2.0重磅发布,合作短剧登顶抖音AI短剧榜No.1

商汤Seko2.0重磅发布,合作短剧登顶抖音AI短剧榜No.1 十三 2025-12-15 14:13:14 ...
反超Nano Banana!OpenAI旗舰图像生成模型上线

反超Nano Banana!OpenAI旗舰图像生成模型上线

反超Nano Banana!OpenAI旗舰图像生成模型上线 Jay 2025-12-17 10:25:43 ...
OpenAI突然开源新模型!99.9%的权重是0,新稀疏性方法代替MoE

OpenAI突然开源新模型!99.9%的权重是0,新稀疏性方法代替MoE

OpenAI突然开源新模型!99.9%的权重是0,新稀疏性方法代替MoE 闻乐 2025-12-14 14:2...
最新评论
ufabet ufabet มีเกมให้เลือกเล่นมากมาย: เกมเดิมพันหลากหลาย ครบทุกค่ายดัง
tornado crypto mixer tornado crypto mixer Discover the power of privacy with TornadoCash! Learn how this decentralized mixer ensures your transactions remain confidential.
ดูบอลสด ดูบอลสด Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
ดูบอลสด ดูบอลสด Pretty! This has been a really wonderful post. Many thanks for providing these details.
ดูบอลสด ดูบอลสด Pretty! This has been a really wonderful post. Many thanks for providing these details.
ดูบอลสด ดูบอลสด Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
Obrazy Sztuka Nowoczesna Obrazy Sztuka Nowoczesna Thank you for this wonderful contribution to the topic. Your ability to explain complex ideas simply is admirable.
ufabet ufabet Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
ufabet ufabet You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
ufabet ufabet Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
热评文章
交大高金朱宁:经济学家视角下AI时代的范式思维转变 | MEET2026

交大高金朱宁:经济学家视角下AI时代的范式思维转变 | MEET2026

交大高金朱宁:经济学家视角下AI时代的范式思维转变 | MEET2026 西风 2025-12-13 12:5...
半世纪难题48小时破解!陶哲轩组队把AI数学玩成打怪游戏了

半世纪难题48小时破解!陶哲轩组队把AI数学玩成打怪游戏了

半世纪难题48小时破解!陶哲轩组队把AI数学玩成打怪游戏了 鹭羽 2025-12-13 22:43:25 来源...
美国视频生成老炮儿,入局世界模型

美国视频生成老炮儿,入局世界模型

美国视频生成老炮儿,入局世界模型 鹭羽 2025-12-13 22:41:00 来源:量子位 三连发:真实场景...
面向「空天具身智能」,北航团队提出星座规划新基准丨NeurIPS’25

面向「空天具身智能」,北航团队提出星座规划新基准丨NeurIPS’25

面向「空天具身智能」,北航团队提出星座规划新基准丨NeurIPS’25 鹭羽 2025-12-13 22:37...
为Token付费是一件很愚蠢的事情,用户应该为智能付费丨RockAI刘凡平@MEET2026

为Token付费是一件很愚蠢的事情,用户应该为智能付费丨RockAI刘凡平@MEET2026

为Token付费是一件很愚蠢的事情,用户应该为智能付费丨RockAI刘凡平@MEET2026 西风 2025-...