首先,我这里用到的是阿里云服务器 centos7版本,win版客户端。
准备工作
centos7 服务器端文件:
https://github.com/rustdesk/rustdesk-server/releases/download/1.1.11-1/rustdesk-server-linux-amd64.zip
win版客户端安装包:https://github.com/rustdesk/rustdesk/releases/download/1.2.7/rustdesk-1.2.7-x86_64.msi
阿里云服务需要开放端口TCP:21115-21119,UDP需要开放21116端口。关闭防火墙,检查端口放行情况。
端口说明:
服务器:
hbbs - RustDesk ID 注册服务器
hbbr - RustDesk 中继服务器
开放端口:
默认情况下,hbbs 监听 21115(tcp) , 21116(tcp/udp) , 21118(tcp) ,hbbr 监听 21117(tcp) , 21119(tcp) 。
TCP/21115 - hbbs 用作 NAT 类型测试
UDP/21116 - hbbs 用作 ID 注册与心跳服务
TCP/21116 - hbbs 用作 TCP 打洞与连接服务
TCP/21117 - hbbr 用作中继服务
TCP/21118/21119 - 网页客户端
云服务器操作
上传服务器文件到阿里云,我这里上传到root文件下进行解压的
unzip rustdesk-server-linux-amd64.zip
解压目录后会出现amd64文件,根据自己的需要可以进行修改为rustdesk。我这里没有进行修改,
[root@iZuf6hl7q5f09c9rycjhccZ amd64]# pwd
/root/amd64
进入到amd64文件夹
[root@iZuf6hl7q5f09c9rycjhccZ amd64]# ll
total 27596
-rwxr-xr-x 1 root root 9165824 May 24 18:49 hbbr
-rwxr-xr-x 1 root root 14353352 May 24 18:49 hbbs
-rwxr-xr-x 1 root root 4734896 May 24 18:49 rustdesk-utils
里面有三个文件。接下来我们要安装个软件,
安装screen,用于虚拟终端
yum -y install screen
准备启动hbbs、hbbr:
# 创建一个叫myHbbs的虚拟终端:
screen -R myHbbs
# 运行hbbs
./hbbs
出现如下图服务已正常启动
[root@iZuf6hl7q5f09c9rycjhccZ amd64]# ./hbbs
[2024-08-23 14:26:48.287942 +08:00] INFO [src/common.rs:148] Private/public key written to id_ed25519/id_ed25519.pub
[2024-08-23 14:26:48.287968 +08:00] INFO [src/rendezvous_server.rs:1191] Key: 2P8Hs+PuXM5gOvD9sSCcB0LbmQlZmB3dCbFk1CYQTyQ=
[2024-08-23 14:26:48.287975 +08:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
[2024-08-23 14:26:48.309974 +08:00] INFO [src/rendezvous_server.rs:99] serial=0
[2024-08-23 14:26:48.310030 +08:00] INFO [src/common.rs:46] rendezvous-servers=[]
[2024-08-23 14:26:48.310039 +08:00] INFO [src/rendezvous_server.rs:101] Listening on tcp/udp :21116
[2024-08-23 14:26:48.310042 +08:00] INFO [src/rendezvous_server.rs:102] Listening on tcp :21115, extra port for NAT test
[2024-08-23 14:26:48.310045 +08:00] INFO [src/rendezvous_server.rs:103] Listening on websocket :21118
[2024-08-23 14:26:48.310072 +08:00] INFO [libs/hbb_common/src/udp.rs:35] Receive buf size of udp [::]:21116: Ok(212992)
[2024-08-23 14:26:48.310122 +08:00] INFO [src/rendezvous_server.rs:138] mask: None
[2024-08-23 14:26:48.310135 +08:00] INFO [src/rendezvous_server.rs:139] local-ip: ""
[2024-08-23 14:26:48.310143 +08:00] INFO [src/common.rs:46] relay-servers=[]
[2024-08-23 14:26:48.310189 +08:00] INFO [src/rendezvous_server.rs:153] ALWAYS_USE_RELAY=N
[2024-08-23 14:26:48.310228 +08:00] INFO [src/rendezvous_server.rs:185] Start
[2024-08-23 14:26:48.310262 +08:00] INFO [libs/hbb_common/src/udp.rs:35] Receive buf size of udp [::]:0: Ok(212992)
[2024-08-23 14:26:48.311725 +08:00] INFO [libs/hbb_common/src/udp.rs:35] Receive buf size of udp 0.0.0.0:0: Ok(212992)
[2024-08-23 14:29:49.764851 +08:00] INFO [src/peer.rs:102] update_pk 1824727186 [::ffff:115.57.95.86]:1053 b"1c9ca672-c6a6-48b1-aeb1-ea1a2720e246" b"\xdc\xf7u\xcd\xf1K\x88i_\xd4\xc4`N\x1d\xf4\xa6W2\xc7h\x83\x11\x81zL+\xdd=q\x08\xa7\xb9"
[2024-08-23 14:30:24.593801 +08:00] INFO [src/peer.rs:102] update_pk 206524240 [::ffff:115.57.95.86]:1090 b"5f0d9299-429e-40db-a792-52b855f56047" b"~S\x93\x97\x91O\x0fr\x0f\x9c\xabR\x12\xad\xa7\xe0\x13\xc5\x04\xd0\xfd\xa6\xfe\xa2f\xdbG\xdc\xc2d\xa9\xd2"
ctrl+a+d 命令退出虚拟终端
# 创建一个叫yHbb的虚拟终端:
screen -R myHbbr
# 运行hbbr
./hbbr
[root@iZuf6hl7q5f09c9rycjhccZ amd64]# ./hbbr
[2024-08-23 14:28:07.647133 +08:00] INFO [src/relay_server.rs:61] #blacklist(blacklist.txt): 0
[2024-08-23 14:28:07.647173 +08:00] INFO [src/relay_server.rs:76] #blocklist(blocklist.txt): 0
[2024-08-23 14:28:07.647179 +08:00] INFO [src/relay_server.rs:82] Listening on tcp :21117
[2024-08-23 14:28:07.647182 +08:00] INFO [src/relay_server.rs:84] Listening on websocket :21119
[2024-08-23 14:28:07.647203 +08:00] INFO [src/relay_server.rs:87] Start
[2024-08-23 14:28:07.647240 +08:00] INFO [src/relay_server.rs:105] DOWNGRADE_THRESHOLD: 0.66
[2024-08-23 14:28:07.647254 +08:00] INFO [src/relay_server.rs:115] DOWNGRADE_START_CHECK: 1800s
[2024-08-23 14:28:07.647256 +08:00] INFO [src/relay_server.rs:125] LIMIT_SPEED: 4Mb/s
[2024-08-23 14:28:07.647258 +08:00] INFO [src/relay_server.rs:136] TOTAL_BANDWIDTH: 1024Mb/s
[2024-08-23 14:28:07.647261 +08:00] INFO [src/relay_server.rs:146] SINGLE_BANDWIDTH: 16Mb/s
[2024-08-23 14:43:31.294349 +08:00] INFO [src/relay_server.rs:441] New relay request 34c462fe-9662-4b9b-b909-425ca1916a88 from [::ffff:115.57.95.86]:2634
[2024-08-23 14:43:31.318296 +08:00] INFO [src/relay_server.rs:425] Relayrequest 34c462fe-9662-4b9b-b909-425ca1916a88 from [::ffff:115.57.95.86]:2635 got paired
[2024-08-23 14:43:31.318318 +08:00] INFO [src/relay_server.rs:431] Both are raw
[2024-08-23 14:43:33.677209 +08:00] INFO [src/relay_server.rs:437] Relay of [::ffff:115.57.95.86]:2635 closed
查看目录是否全部正常运行;
[root@iZuf6hl7q5f09c9rycjhccZ amd64]# ls
db_v2.sqlite3 db_v2.sqlite3-shm db_v2.sqlite3-wal hbbr hbbs id_ed25519 id_ed25519.pub rustdesk-utils
id_ed25519.pub 其内容是端户端的key,后面要用到配置。
windows客户端配置操作
点击上方3个点进入设置。
状态变成就绪了。完成配置!
问题
连接出现KEY不匹配问题:
1.版本不匹配问题。
2.还是密钥问题,仔细检查密钥内容。