A service of Daily Data, Inc.
Contact Form

User Tools

Site Tools


software:rust:server_devuan

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
software:rust:server_devuan [2025/09/18 23:55] rodolicosoftware:rust:server_devuan [2025/09/29 16:51] (current) rodolico
Line 1: Line 1:
 ====== RustDesk Server on Devuan ====== ====== RustDesk Server on Devuan ======
- 
-<WRAP center round alert 60%> 
-Warning. I am still editing this on 18 Sep 2025. Do not use these instructions until I have finished editing, then tested the procedure. This notice will be removed at that time. 
-</WRAP> 
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-The RustDesk Server must be accessible from any connecting clients on ports 21115-21119, TCP and UDP. If any workstation will be accessing from outside your network, you will need to forward those ports on your router to your server+The RustDesk Server must be accessible from any connecting clients on ports 21114-21119, TCP and UDP. If any workstation will be accessing from outside your network, you will need to forward those ports on your router to your server. Not all are required for all installations. See section //Open Ports// for more information.
 </WRAP> </WRAP>
  
Line 14: Line 10:
  
 This article describes how to set up the Rust Server on Devuan, and may be helpful for other systems also. This article describes how to set up the Rust Server on Devuan, and may be helpful for other systems also.
 +
 +
 +===== Open Ports =====
 +
 +On your firewall/NAT/whatever, you need ports <code>21114,21115,21116,21117,21118,21119</code> open and forwarded to the Rust Server. Additionally, to use the webui, you will need to open a port for that.
 +
 +Following table shows what the ports are used for.
 +
 +^Port   ^Purpose                ^Protocol^Notes^
 +| 21114 | HBBS (RustDesk server) | TCP     | Default port for API (not required)         |
 +| 21115 | HBBS (RustDesk server) | TCP/UDP | Default port for the RustDesk server.       |
 +| 21116 | HBBS (RustDesk server) | TCP/UDP | Used for client connections to the server.  |
 +| 21117 | HBBS (RustDesk server) | TCP/UDP | Additional port for server communication.   |
 +| 21118 | HBBS (RustDesk server) | TCP/UDP | Another port for server communication.      |
 +| 21119 | HBBS (RustDesk server) | TCP/UDP | Used for additional server functionalities. |
 +| 80 | HTTP (optional fallback) | TCP | Commonly allowed port for web traffic; can be used for fallback. |
 +| 443 | HTTPS (optional fallback) | TCP | Secure web traffic; can be used for fallback   |
  
 ===== Set up user ===== ===== Set up user =====
Line 58: Line 71:
 <code bash> <code bash>
 cd /opt/rustdesk cd /opt/rustdesk
-sudo -u rust ./rustdesk-utils genkeypair 
 echo Starting signaling server for testing. Press ^c to exit when you are happy echo Starting signaling server for testing. Press ^c to exit when you are happy
 sudo -u rust ./hbbs sudo -u rust ./hbbs
Line 87: Line 99:
 ### END INIT INFO ### END INIT INFO
  
-dir="/opt/rust+dir="/opt/rustdesk
-cmd="hbbs"+cmd="/opt/rustdesk/hbbs"
 user="rust" user="rust"
  
 name=`basename $0` name=`basename $0`
 pid_file="/var/run/$name.pid" pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log" +stdout_log="/var/log/rustdesk/$name.log" 
-stderr_log="/var/log/$name.err"+stderr_log="/var/log/rustdesk/$name.err"
  
 get_pid() { get_pid() {
Line 184: Line 196:
 #!/bin/sh #!/bin/sh
 ### BEGIN INIT INFO ### BEGIN INIT INFO
-# Provides:          hbbs+# Provides:          hbbr
 # Required-Start:    $remote_fs $syslog # Required-Start:    $remote_fs $syslog
 # Required-Stop:     $remote_fs $syslog # Required-Stop:     $remote_fs $syslog
Line 193: Line 205:
 ### END INIT INFO ### END INIT INFO
  
-dir="/opt/rust+dir="/opt/rustdesk
-cmd="hbbr"+cmd="/opt/rustdesk/hbbr"
 user="rust" user="rust"
  
 name=`basename $0` name=`basename $0`
 pid_file="/var/run/$name.pid" pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log" +stdout_log="/var/log/rustdesk/$name.log" 
-stderr_log="/var/log/$name.err"+stderr_log="/var/log/rustdesk/$name.err"
  
 get_pid() { get_pid() {
Line 281: Line 293:
  
 exit 0 exit 0
 +
 </code> </code>
  
Line 299: Line 312:
 If you made it through the last step with no errors, you should now be able to access the server from one of the clients. If you made it through the last step with no errors, you should now be able to access the server from one of the clients.
  
-===== Optional Steps =====+===== Set automatic log rotate =====
  
-The script that techahold wrote will ask permission, then automatically install a lightweight web server and create customized installers for Windows and Linux. I'm not going into that herebut it is pretty straightforwardAnother github userdinger1986, has install scripts for [[https://raw.githubusercontent.com/dinger1986/rustdeskinstall/master/WindowsAgentAIOInstall.ps1|Microsoft Windows]] and many flavors of [[https://raw.githubusercontent.com/dinger1986/rustdeskinstall/master/linuxclientinstall.sh|Linux]] (not Devuan, unfortunately).+Your logs can get quite largeso it is best to rotate them occassionalDevuan uses the logrotate script to do this for, and it is fairly simple to add a new definition in /etc/logrotate.d for the next pass.
  
-Basically, you can download those scripts and run the following commands on themThenmake them available to your users who can run them on their computer and have RustDesk Client installed on their computer, already set up for your server.+Following command will create the definitionIt will rotate the hbbr/hbbs logs dailykeeping two weeks of logs. All logs except for the current one and the previous one will be compressed.
  
-Download and edit the following file. Change your.url.or.ip to the URL or IP of your new server, and change contents_of_public_key_file_on_your_server to the contents of /opt/rustdesk/id_ed25519.pub. When done, you will have two files, //WindowsAgentAIOInstall.ps1//, which can be run with Windows Power Shell, and //linuxclientinstall.sh// which can be run from the command line on a Linux machine.+This is just one command. Just copy and paste it anywhere into the server.
  
-<code bash> +<code bash rotatelogs
-#!/usr/bin/env sh +cat << EOF > /etc/logrotate.d/rustdesk 
- +/var/log/rustdesk/*.log /var/log/rustdesk/*.err 
-WANIP=your.url.or.ip +   daily 
-KEY=contents_of_public_key_file_on_your_server +   rotate 14 
-string="{\"host\":\"${wanip}\",\"relay\":\"${wanip}\",\"key\":\"${key}\",\"api\":\"https://${wanip}\"}" +   compress 
-string64=$(echo -n "$string" | base64 -w 0 | tr -d '='+   delaycompress 
-string64rev=$(echo -n "$string64" | rev) +   create 640 rust rust 
-wget https://raw.githubusercontent.com/dinger1986/rustdeskinstall/master/WindowsAgentAIOInstall.ps1 +   postrotate 
-sudo sed -i "s|secure-string|${string64rev}|g" WindowsAgentAIOInstall.ps1 +      service hbbr restart > /dev/null 
-# Create linux install script +      service hbbs restart > /dev/null 
-wget https://raw.githubusercontent.com/dinger1986/rustdeskinstall/master/linuxclientinstall.sh +   endscript 
-sudo sed -i "s|secure-string|${string64rev}|g" linuxclientinstall.sh+   sharedscripts 
 +   missingok 
 +   notifempty 
 +} 
 +EOF
 </code> </code>
 +
  
 ===== Links ===== ===== Links =====
software/rust/server_devuan.1758257754.txt.gz · Last modified: 2025/09/18 23:55 by rodolico