* fix: key file perm Signed-off-by: fufesou <linlong1266@gmail.com> * fix: enforce secure private key permissions on Unix Create new keys with mode 0600 and verify permissions before writing. Tighten existing keys to 0600 and propagate permission failures. Preserve dangling symlinks and clean up failed key creation. Signed-off-by: fufesou <linlong1266@gmail.com> * fix: preserve read-only keys and prevent public key clobbering Accept existing 0400 keys without changing their permissions. Write the public key only after private key creation and writing succeed. Signed-off-by: fufesou <linlong1266@gmail.com> * fix: generate missing public keys and reject mismatched key pairs Signed-off-by: fufesou <linlong1266@gmail.com> * fix: publish public keys atomically without overwriting existing files Signed-off-by: fufesou <linlong1266@gmail.com> * fix: key file perms, comments Signed-off-by: fufesou <linlong1266@gmail.com> * fix: reject key conflicts and clean up failed private key writes Reuse symlink resolution and simplify key loading and regression tests. Signed-off-by: fufesou <linlong1266@gmail.com> * fix: key file perm, simple refactor Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
RustDesk Server Program
Configuration & environment variables
Self-host your own RustDesk server, it is free and open source.
Important
Need more features? RustDesk Server Pro might suit you better.
Want to develop your own server? Start with rustdesk-server-demo, a simpler starting point than this repository.
How to build manually
cargo build --release
Three executables will be generated in target/release.
- hbbs - RustDesk ID/Rendezvous server
- hbbr - RustDesk relay server
- rustdesk-utils - RustDesk CLI utilities
You can find updated binaries on the Releases page.
Configuration
hbbs and hbbr can be configured with command-line flags, environment
variables, or an .env / config file. Run hbbs --help or hbbr --help to see
the available flags.
The most common options:
| Option | Flag | Env var | Applies to | Purpose |
|---|---|---|---|---|
| Key | -k |
KEY |
hbbs, hbbr | hbbs loads/generates one by default |
| Bind address | -b |
BIND |
hbbs, hbbr | Local IP address to listen on (default: all interfaces; requires 1.1.17+) |
| Port | -p |
PORT |
hbbs, hbbr | Listening port (hbbs 21116, hbbr 21117) |
| Relay servers | -r |
RELAY-SERVERS |
hbbs | Override when the relay uses a different address or a non-standard port |
| Force relay | — | ALWAYS_USE_RELAY |
hbbs | Y disables direct connections |
| Log level | — | RUST_LOG |
hbbs, hbbr | e.g. debug (default info) |
See docs/environment-variables.md for the full list of variables, the file/flag/env precedence rules, database and relay bandwidth tuning, Docker image variables, and examples.
Installation
Please follow this doc