Remote terminal(rtmn) is…
rtmn is a terminal gateway between Telegram and a Linux shell. When an allowed Telegram chat sends plain text, rtmn forwards that text to the configured Linux shell and returns the command output to Telegram.
Basic Flow
Telegram chat
-> Telegram Bot API
-> rtmn systemd service
-> configured Linux user shell
-> command output
-> Telegram chat
Components
| Component | Description |
|---|---|
| Gateway | Telegram Bot API long polling |
| Runtime | systemd service |
| Program | Static Go single binary |
| Execution identity | Configured Linux user account |
| Configuration storage | systemd EnvironmentFile |
| Logs | journald and audit log |
Installation Models
rtmn can be operated in two models.
| Model | Use Case | Service Example |
|---|---|---|
| Single-instance installation | One gateway is needed on the server | rtmn.service |
| Account-isolated installation | Multiple account-specific gateways are needed on one server | rtmn-ops.service, rtmn-app.service |
Single-instance installation uses the built-in install command. Account-isolated installation creates systemd unit files manually so each service name, binary path, environment file, and audit log path is unique.
Operational Risk
rtmn is a message-based remote shell access tool. If an allowed Telegram chat ID is compromised or mistakenly allowlisted, commands can be executed with the permissions of the configured Linux account.
Follow these operating principles:
- Keep the allowed chat list minimal.
- Run the service with the least-privileged Linux account that can perform the required work.
- Use a separate bot token for each server or concurrently running instance.
- Check environment file and log permissions after installation.