software:rust:server_devuan
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
software:rust:server_devuan [2025/09/18 07:29] – created rodolico | software:rust:server_devuan [2025/09/18 11:18] (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. | ||
+ | </ | ||
+ | |||
We use [[https:// | We use [[https:// | ||
- | The Rust Server install script unfortunately assumes SystemD, and will fail halfway through as it is attempting to set up the SystemD service. The same is true of the .deb package which is available. | + | An excellent |
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. | ||
Line 9: | Line 14: | ||
===== Set up user ===== | ===== Set up user ===== | ||
- | Rust Server does not require any special privileges, so creating a separate user account instead of running as root greatly enhances security. The following few lines assume we will install rust in /opt/rust, and the log files will be stored in /var/log/rust/* | + | Rust Server does not require any special privileges, so creating a separate user account instead of running as root greatly enhances security. The following few lines assume we will install rust in /opt/rustdesk, and the log files will be stored in /var/log/rustdesk/*, and a system user named rust |
- | <code bash setupRust> | + | <code bash setupRustDeskServer> |
#! / | #! / | ||
- | useradd --shell / | + | useradd --shell / |
- | mkdir /opt/rust | + | mkdir /opt/rustdesk |
- | mkdir /var/log/rust | + | mkdir /var/log/rustdesk |
- | chown rust:rust /opt/rust | + | chown rust:rust /opt/rustdesk |
- | chown rust:rust /var/log/rust | + | chown rust:rust /var/log/rustdesk |
</ | </ | ||
+ | |||
+ | ===== Download Server ===== | ||
+ | |||
+ | Open a web browser to https:// | ||
+ | |||
+ | <code bash> | ||
+ | cd /tmp | ||
+ | wget ###Paste the URL from above here### | ||
+ | unzip rustdesk-server-linux-amd64.zip | ||
+ | mv / | ||
+ | chown rust:rust / | ||
+ | </ | ||
+ | |||
+ | This will create three binary files in / | ||
+ | * hbbr - The relay server. If a direct P2P connection can not be made, this will be used to relay traffic between clients. | ||
+ | * hbbs - this is the " | ||
+ | * rustdesk-utils - a utility program that can generate/ | ||
+ | |||
+ | ===== Run for first time ===== | ||
+ | |||
+ | The first time you run the signal server (hbbs), it will note that the key pair used for authentication does not exist and generate them. These keys are stored in the files: | ||
+ | * id_ed25519 - the private key | ||
+ | * id_ed25519.pub - the public key required by any client wanting to connect to this server | ||
+ | |||
+ | **Note**: The check is made in the current working directory, so you **must** run hbbs from within it's home directory (/ | ||
+ | |||
+ | A way that gives you more control is to run the rustdesk-utils, | ||
+ | |||
+ | <code bash> | ||
+ | cd / | ||
+ | sudo -u rust ./ | ||
+ | # verify they exist | ||
+ | ls -ablph id_ed25519* | ||
+ | # make them owned by the rust user | ||
+ | chown rust:rust id_ed25519* | ||
+ | sudo -u rust ./hbbs | ||
+ | # watch for errors, press ^c to leave. | ||
+ | |||
+ | echo Your key for the clients is | ||
+ | cat id_ed25519.pub | ||
+ | echo To find this again at a later date, just run the command cat id_ed25519.pub | ||
+ | </ | ||
+ | |||
+ | ===== Set automatic run ===== | ||
+ | |||
+ | Everything up to this point will work on all Unix systems, and we have done nothing that techahold' | ||
+ | |||
+ | Copy the following two files to /etc/init.d (Devuan), or wherever your init scripts are stored. By the way, I built these starting with the template at [[https:// | ||
+ | |||
+ | <code bash hbbs> | ||
+ | #!/bin/sh | ||
+ | ### BEGIN INIT INFO | ||
+ | # Provides: | ||
+ | # Required-Start: | ||
+ | # Required-Stop: | ||
+ | # Default-Start: | ||
+ | # Default-Stop: | ||
+ | # Short-Description: | ||
+ | # Description: | ||
+ | ### END INIT INFO | ||
+ | |||
+ | dir="/ | ||
+ | cmd=" | ||
+ | user=" | ||
+ | |||
+ | name=`basename $0` | ||
+ | pid_file="/ | ||
+ | stdout_log="/ | ||
+ | stderr_log="/ | ||
+ | |||
+ | get_pid() { | ||
+ | cat " | ||
+ | } | ||
+ | |||
+ | is_running() { | ||
+ | [ -f " | ||
+ | } | ||
+ | |||
+ | case " | ||
+ | start) | ||
+ | if is_running; then | ||
+ | echo " | ||
+ | else | ||
+ | echo " | ||
+ | cd " | ||
+ | if [ -z " | ||
+ | sudo $cmd >> " | ||
+ | else | ||
+ | sudo -u " | ||
+ | fi | ||
+ | echo $! > " | ||
+ | if ! is_running; then | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | fi | ||
+ | ;; | ||
+ | stop) | ||
+ | if is_running; then | ||
+ | echo -n " | ||
+ | kill `get_pid` | ||
+ | for i in 1 2 3 4 5 6 7 8 9 10 | ||
+ | # for i in `seq 10` | ||
+ | do | ||
+ | if ! is_running; then | ||
+ | break | ||
+ | fi | ||
+ | |||
+ | echo -n " | ||
+ | sleep 1 | ||
+ | done | ||
+ | echo | ||
+ | |||
+ | if is_running; then | ||
+ | echo "Not stopped; may still be shutting down or shutdown may have failed" | ||
+ | exit 1 | ||
+ | else | ||
+ | echo " | ||
+ | if [ -f " | ||
+ | rm " | ||
+ | fi | ||
+ | fi | ||
+ | else | ||
+ | echo "Not running" | ||
+ | fi | ||
+ | ;; | ||
+ | restart) | ||
+ | $0 stop | ||
+ | if is_running; then | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | $0 start | ||
+ | ;; | ||
+ | status) | ||
+ | if is_running; then | ||
+ | echo " | ||
+ | else | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | ;; | ||
+ | *) | ||
+ | echo " | ||
+ | exit 1 | ||
+ | ;; | ||
+ | esac | ||
+ | |||
+ | exit 0 | ||
+ | </ | ||
+ | |||
+ | <code bash hbbr> | ||
+ | #!/bin/sh | ||
+ | ### BEGIN INIT INFO | ||
+ | # Provides: | ||
+ | # Required-Start: | ||
+ | # Required-Stop: | ||
+ | # Default-Start: | ||
+ | # Default-Stop: | ||
+ | # Short-Description: | ||
+ | # Description: | ||
+ | ### END INIT INFO | ||
+ | |||
+ | dir="/ | ||
+ | cmd=" | ||
+ | user=" | ||
+ | |||
+ | name=`basename $0` | ||
+ | pid_file="/ | ||
+ | stdout_log="/ | ||
+ | stderr_log="/ | ||
+ | |||
+ | get_pid() { | ||
+ | cat " | ||
+ | } | ||
+ | |||
+ | is_running() { | ||
+ | [ -f " | ||
+ | } | ||
+ | |||
+ | case " | ||
+ | start) | ||
+ | if is_running; then | ||
+ | echo " | ||
+ | else | ||
+ | echo " | ||
+ | cd " | ||
+ | if [ -z " | ||
+ | sudo $cmd >> " | ||
+ | else | ||
+ | sudo -u " | ||
+ | fi | ||
+ | echo $! > " | ||
+ | if ! is_running; then | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | fi | ||
+ | ;; | ||
+ | stop) | ||
+ | if is_running; then | ||
+ | echo -n " | ||
+ | kill `get_pid` | ||
+ | for i in 1 2 3 4 5 6 7 8 9 10 | ||
+ | # for i in `seq 10` | ||
+ | do | ||
+ | if ! is_running; then | ||
+ | break | ||
+ | fi | ||
+ | |||
+ | echo -n " | ||
+ | sleep 1 | ||
+ | done | ||
+ | echo | ||
+ | |||
+ | if is_running; then | ||
+ | echo "Not stopped; may still be shutting down or shutdown may have failed" | ||
+ | exit 1 | ||
+ | else | ||
+ | echo " | ||
+ | if [ -f " | ||
+ | rm " | ||
+ | fi | ||
+ | fi | ||
+ | else | ||
+ | echo "Not running" | ||
+ | fi | ||
+ | ;; | ||
+ | restart) | ||
+ | $0 stop | ||
+ | if is_running; then | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | $0 start | ||
+ | ;; | ||
+ | status) | ||
+ | if is_running; then | ||
+ | echo " | ||
+ | else | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | ;; | ||
+ | *) | ||
+ | echo " | ||
+ | exit 1 | ||
+ | ;; | ||
+ | esac | ||
+ | |||
+ | exit 0 | ||
+ | </ | ||
+ | |||
+ | Now (we're almost done), run the following commands to start the both servers up. | ||
+ | |||
+ | <code bash> | ||
+ | chmod 755 / | ||
+ | chmod 755 / | ||
+ | # test hbbs | ||
+ | / | ||
+ | # test hbbr | ||
+ | / | ||
+ | # if both worked correctly, run the following command to automatically start at boot | ||
+ | update-rc.d hbbs defaults | ||
+ | update-rc.d hbbr defaults | ||
+ | </ | ||
+ | |||
+ | 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 ===== | ||
+ | |||
+ | 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 here, but it is pretty straightforward. Another github user, dinger1986, has install scripts for [[https:// | ||
+ | |||
+ | Basically, you can download those scripts and run the following commands on them. Then, make 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. | ||
+ | |||
+ | 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 / | ||
+ | |||
+ | <code bash> | ||
+ | # | ||
+ | |||
+ | WANIP=your.url.or.ip | ||
+ | KEY=contents_of_public_key_file_on_your_server | ||
+ | string=" | ||
+ | string64=$(echo -n " | ||
+ | string64rev=$(echo -n " | ||
+ | wget https:// | ||
+ | sudo sed -i " | ||
+ | # Create linux install script | ||
+ | wget https:// | ||
+ | sudo sed -i " | ||
+ | </ | ||
+ | |||
+ | ===== Links ===== | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |
software/rust/server_devuan.1758198595.txt.gz · Last modified: 2025/09/18 07:29 by rodolico