Overview

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

ComponentDescription
GatewayTelegram Bot API long polling
Runtimesystemd service
ProgramStatic Go single binary
Execution identityConfigured Linux user account
Configuration storagesystemd EnvironmentFile
Logsjournald and audit log

Installation Models

rtmn can be operated in two models.

ModelUse CaseService Example
Single-instance installationOne gateway is needed on the serverrtmn.service
Account-isolated installationMultiple account-specific gateways are needed on one serverrtmn-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.

Was this page helpful?

Last update