Remote administration of a dedicated Rust server centers around the Remote Console (RCON) protocol. Unlike managing infrastructure through cumbersome web consoles, headless command-line interfaces enable operators to automate recurring server maintenance — broadcasting player announcements, enforcing atomic server.save writes, kicking violators, and scraping telemetry — using standard shell pipelines and Linux cron.
This practical guide explores Rust RCON configuration parameters, network socket hardening, using CLI utilities to dispatch commands programmatically, and building automated maintenance shell scripts.
Rust RCON Architecture: Ports and WebSockets#
Modern Rust server builds support two distinct RCON modes: legacy Source RCON and WebSocket RCON (recommended, toggled via +rcon.web 1).
Verify active connectivity settings within the server configuration file:
cat /opt/rust-server/server/my_server_identity/cfg/server.cfg | grep -E "rcon\."
Essential parameters include:
rcon.port 28016— Transport port for administrative packets.rcon.password "SuperSecretPass123"— Authentication token.rcon.web 1— Enables structured WebSocket framing for third-party tooling.
Network Security and Inbound Port Isolation#
The RCON socket must never be exposed unfiltered to the public internet. Malicious actors continuously execute brute-force attacks against open port 28016, seeking complete server takeover.
Constrain inbound access to port 28016 using Ubuntu's UFW firewall, whitelisting only your static administrative management IP:
sudo ufw allow from 192.168.1.100 to any port 28016 proto tcp
If automation scripts run locally on the host machine, bind the socket strictly to the loopback adapter using rcon.ip 127.0.0.1.
Compiling a Lightweight RCON CLI Utility#
To dispatch automated console commands from terminal sessions and shell scripts, compile the lightweight mcrcon utility:
curl -sL https://raw.githubusercontent.com/Tiiffi/mcrcon/master/mcrcon.c -o /tmp/mcrcon.c && gcc /tmp/mcrcon.c -o /usr/local/bin/mcrcon && chmod +x /usr/local/bin/mcrcon
Verify the connection and query active server metrics:
mcrcon -H 127.0.0.1 -P 28016 -p "SuperSecretPass123" "serverinfo"
The server responds with a structured JSON string detailing server tick framerate, concurrent player counts, heap memory usage, and entity counts.
Automated World Saving and Player Warning Pipeline#
Deploy the following shell script to broadcast an in-game warning and force an immediate world write prior to scheduled backup routines:
#!/bin/bash
RCON_HOST="127.0.0.1"
RCON_PORT="28016"
RCON_PASS="SuperSecretPass123"
/usr/local/bin/mcrcon -H $RCON_HOST -P $RCON_PORT -p $RCON_PASS "say [SERVER] Automated save initiated..."
/usr/local/bin/mcrcon -H $RCON_HOST -P $RCON_PORT -p $RCON_PASS "save"
Verify scheduled execution inside your Linux job schedule:
crontab -l | grep rcon
If you require a high-performance Rust server featuring automated wipe schedules, built-in RCON web consoles, and multi-terabit DDoS mitigation without tedious manual firewall administration, managed Rust server hosting provides complete infrastructure control through an intuitive control panel.




