PowerShell and Debian scripts for deploying and managing RustDesk remote desktop software in enterprise environments. These scripts are designed for use with Action1 RMM platform but can be adapted for standalone use.
Use at your own risk. These scripts are provided "as is", without warranty of any kind. They install software, modify system configuration, and set credentials — review them before running and test on a non-production machine first. See LICENSE-2.0.txt for full terms.
- PowerShell 7.0 or higher
- Administrator privileges
- Windows operating system
- Network access to download RustDesk installer (for deployment script)
Action1 PowerShell scripts (Windows):
- act1-deploy-rustdesk.ps1 — download, install, configure with EXE installer
- act1-deploy-rustdesk-msi.ps1 — download, install, configure with MSI installer
- act1-update-rustdesk-config.ps1 — update server/key on an existing install
- act1-change-rustdesk-password.ps1 — set the permanent password
- act1-print-rustdesk-config.ps1 — print current config (version, ID, server, key)
Debian/Ubuntu bash scripts (Linux):
- debian-install-rustdesk.sh — download, install, configure via
.deb - debian-update-rustdesk-config.sh — update server/key on an existing install
- debian-change-rustdesk-password.sh — set the permanent password
- debian-print-rustdesk-config.sh — print current config
Purpose: Downloads, installs, and configures RustDesk with custom server settings and a permanent password.
Usage:
# Run with Administrator privileges
.\act1-deploy-rustdesk.ps1Parameters (configured in script or via Action1):
id-server: Your RustDesk ID server address (required)relay-server: Your relay server address (optional, can be blank)api-server: API server for RustDesk Pro (optional, can be blank)key: Public key for server authentication (required)password: Permanent password for the RustDesk client (required)
What it does:
- Downloads RustDesk installer from GitHub (currently v1.2.3)
- Performs silent installation
- Sets the permanent password
- Configures server settings in the TOML configuration file
- Reports the RustDesk client ID upon completion
Notes:
- Installer is downloaded to temp folder and cleaned up after installation
- Configuration file is located at:
C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk.toml - Installation directory:
C:\Program Files\RustDesk
Purpose: Same as act1-deploy-rustdesk.ps1 but uses the MSI installer invoked via msiexec /qn ADDLOCAL=ALL. Useful in environments that prefer MSI for Group Policy / RMM tracking.
Parameters: identical to act1-deploy-rustdesk.ps1 (id-server, relay-server, api-server, key, password).
What it does: same flow as the EXE variant — resolve version from GitHub, skip if already current, MSI install, wait for service, push server options and password via rustdesk.exe --option / --password.
Purpose: Updates an existing RustDesk installation with new server configuration details.
Usage:
# Run with Administrator privileges
.\act1-update-rustdesk-config.ps1Parameters (configured in script or via Action1):
id-server: New RustDesk ID server address (required)relay-server: New relay server address (optional, can be blank)api-server: New API server for RustDesk Pro (optional, can be blank)key: New public key for server authentication (required)
What it does:
- Validates that RustDesk is already installed
- Updates the existing TOML configuration file with new server details
- Preserves other existing configuration settings
Notes:
- Does not change the permanent password
- May require RustDesk service restart for changes to take effect
- Will fail if RustDesk is not already installed
Purpose: Sets the permanent password on an existing RustDesk installation.
Parameters: password (required).
What it does: verifies admin privileges, waits for the Rustdesk service to be running, calls rustdesk.exe --password <value> over IPC. Errors out if RustDesk isn't installed.
Purpose: Reads and prints the current RustDesk version, client ID, ID/relay/API server, and key from the running service.
Parameters: none.
What it does: waits for the service, then calls rustdesk.exe --version, --get-id, and --option <key> (read mode) over IPC. Empty options are shown as (not set).
These scripts are designed to work with Action1 RMM platform. When used in Action1:
- Create a new script in Action1
- Copy the PowerShell script content
- Define parameters in Action1 matching the script variables:
id-serverrelay-serverapi-serverkeypassword(for deploy script only)
- Deploy to target machines through Action1 policies
To use these scripts outside of Action1:
- Edit the script files directly
- Replace the
${parameter}placeholders with actual values:$rustdeskIdServer = "your-server.example.com" $rustdeskRelayServer = "your-relay.example.com" $rustdeskApiServer = "" # Leave blank if not using RustDesk Pro $rustdeskKey = "your-public-key-here" $rustdeskPermanentPassword = "YourSecurePassword123!"
- Run the script with Administrator privileges
RustDesk's --option and --password CLI flags behave the same on Linux as on Windows, so the logic of the Action1 PowerShell scripts maps directly. Packaged bash equivalents: debian-install-rustdesk.sh, debian-update-rustdesk-config.sh, debian-print-rustdesk-config.sh, and debian-change-rustdesk-password.sh.
Grab the raw scripts from GitHub (review before running).
curl — one at a time:
curl -fsSLO https://raw.githubusercontent.com/pblakez/rustdesk-scripts/main/debian-install-rustdesk.sh
curl -fsSLO https://raw.githubusercontent.com/pblakez/rustdesk-scripts/main/debian-update-rustdesk-config.sh
curl -fsSLO https://raw.githubusercontent.com/pblakez/rustdesk-scripts/main/debian-change-rustdesk-password.sh
curl -fsSLO https://raw.githubusercontent.com/pblakez/rustdesk-scripts/main/debian-print-rustdesk-config.sh
chmod +x debian-*.shwget:
wget https://raw.githubusercontent.com/pblakez/rustdesk-scripts/main/debian-install-rustdesk.sh
wget https://raw.githubusercontent.com/pblakez/rustdesk-scripts/main/debian-update-rustdesk-config.sh
wget https://raw.githubusercontent.com/pblakez/rustdesk-scripts/main/debian-change-rustdesk-password.sh
wget https://raw.githubusercontent.com/pblakez/rustdesk-scripts/main/debian-print-rustdesk-config.sh
chmod +x debian-*.shGrab-all one-liner (curl):
for s in debian-install-rustdesk.sh debian-update-rustdesk-config.sh debian-change-rustdesk-password.sh debian-print-rustdesk-config.sh; do
curl -fsSLO "https://raw.githubusercontent.com/pblakez/rustdesk-scripts/main/$s"
done && chmod +x debian-*.shDebian/Ubuntu equivalent of act1-deploy-rustdesk-msi.ps1. Takes its parameters from the CLI instead of Action1 placeholders.
sudo ./debian-install-rustdesk.sh \
--id-server id.example.com \
--key "<public-key>" \
--password 'YourS3cureP@ssw0rd!' \
--relay-server relay.example.com \
--api-server "" \
--version 1.4.1 # optional; omit for latest from GitHubWhat it does (same flow as the MSI script):
- Resolves the target version (GitHub
releases/latest, or--version). - Skips download/install if the installed
rustdeskpackage is already at or above the target (usesdpkg --compare-versions). - Downloads
rustdesk-<version>-<arch>.debfrom GitHub (x86_64 / aarch64 / armv7). - Installs with
dpkg -i, falling back toapt-get install -fto resolve deps. - Enables and starts
rustdesk.service, waits for it to become active. - Pushes
custom-rendezvous-server,relay-server,api-server,keyviarustdesk --option. - Sets the permanent password via
rustdesk --password. - Prints the client ID.
Always re-applies the config even when the install is skipped, so the same script handles first-install and server-detail updates on already-provisioned boxes.
- Binary:
/usr/bin/rustdesk(symlink to/usr/share/rustdesk/rustdesk) - Systemd unit:
rustdesk.serviceat/lib/systemd/system/rustdesk.serviceExecStart=/usr/bin/rustdesk --service, runs asroot
- Service config dir (the one the service reads, since it runs as root):
/root/.config/rustdesk/- Contains
RustDesk.toml,RustDesk2.toml,RustDesk_local.toml, etc.
- Contains
- User config dir (per-user GUI session):
~/.config/rustdesk/ - Logs:
~/.local/share/logs/RustDesk/
Debian/Ubuntu equivalent of act1-update-rustdesk-config.ps1. Updates server/key on an existing install; does not install RustDesk and does not change the password.
sudo ./debian-update-rustdesk-config.sh \
--id-server id.example.com \
--key "<public-key>" \
--relay-server relay.example.com \
--api-server ""Errors out with "Nothing to update" if RustDesk isn't installed. Waits for the service to become active before writing, same IPC caveat as Windows.
Raw-command equivalent (if you'd rather not run the script):
sudo systemctl start rustdesk
sudo rustdesk --option custom-rendezvous-server <id-server>
sudo rustdesk --option relay-server <relay-server> # "" to clear
sudo rustdesk --option api-server <api-server> # "" to clear
sudo rustdesk --option key <public-key>Read a value back with sudo rustdesk --option <key> (no value argument).
Alternative bulk import (useful for first-run provisioning):
sudo rustdesk --import-config /path/to/RustDesk2.tomlDebian/Ubuntu equivalent of act1-print-rustdesk-config.ps1. Prints the current RustDesk version, client ID, ID/relay/API server, and key.
sudo ./debian-print-rustdesk-config.shEmpty options show as (not set). Waits for the service to become active first, same IPC caveat as the other scripts.
Raw-command equivalent:
sudo systemctl start rustdesk
rustdesk --version
rustdesk --get-id
sudo rustdesk --option custom-rendezvous-server
sudo rustdesk --option relay-server
sudo rustdesk --option api-server
sudo rustdesk --option keyEach --option <key> with no value prints the current setting (empty line = not set). One-liner:
for k in custom-rendezvous-server relay-server api-server key; do
printf '%-26s %s\n' "$k:" "$(sudo rustdesk --option "$k")"
doneDebian/Ubuntu equivalent of act1-change-rustdesk-password.ps1. Sets the permanent password on an existing install.
sudo ./debian-change-rustdesk-password.sh --password '<NewPermanentPassword>'Errors out with "Nothing to update" if RustDesk isn't installed. Waits for the service to become active before writing.
Raw-command equivalent:
sudo systemctl start rustdesk
sudo rustdesk --password '<NewPermanentPassword>'rustdesk --get-id # print this machine's RustDesk ID
sudo systemctl status rustdesk # service state
sudo systemctl restart rustdesk # apply changes that need a restart
sudo systemctl enable --now rustdesk # start now + enable at bootSee wayland-no-displays-notes.md for the Xorg switch, allow-linux-headless flow, and GUI toggle.
- The service runs as
root, so its effective config lives under/root/.config/rustdesk/, not the logged-in user's~/.config/rustdesk/. Editing the user file will not affect the service. --optionand--passwordboth require the service to be running; if it's stopped, writes can silently land in the wrong profile.- Install via the official
.debfrom github.com/rustdesk/rustdesk/releases:sudo apt install ./rustdesk-<version>.deb.
- Scripts require Administrator privileges to modify system files
- Permanent passwords are set via command line (may be visible in process lists)
- Configuration files contain server connection details
- Ensure scripts are stored and transmitted securely
- Consider using encrypted variables in Action1 for sensitive parameters
Script fails with permission error:
- Ensure running with Administrator privileges
- Right-click PowerShell and select "Run as Administrator"
Configuration file not found:
- Verify RustDesk is installed correctly
- Check if service is running
- Wait a few seconds after installation for config file creation
RustDesk installer download fails:
- Check network connectivity
- Verify the GitHub URL is accessible
- Update installer URL if using a different RustDesk version
Changes not taking effect:
- Restart the RustDesk service
- Reboot the machine if necessary
- Verify configuration file was updated correctly
Licensed under the Apache License, Version 2.0 — see LICENSE-2.0.txt. RustDesk itself is distributed under its own license.