ssh-bot
Описание
Telegram бот, который позволяет запускать заданные команды на выбранном хосте в домашней сети и возвращать результат их выполнения. Бот не устанавливает постоянное соединение с удаленным хостом, что позволяет выполнять команды асинхронно.
Языки
- Go98,4%
- Dockerfile1,6%
SSH Bot
English (🇺🇸) | Русский (🇷🇺)
Telegram bot that allows you to run specified commands on a selected host in your home network and return the result of their execution. The bot does not establish a permanent connection with the remote host, which allows you to execute commands asynchronously.
The bot provides the ability to not waste time setting up a server and money on an external IP address or server to access the local network, and also eliminates the need to use third-party applications ( and clients) on a remote device and does not require a stable Internet connection.

Roadmap
- Executing commands on the local (the one where the bot is running) or remote host (via
) in the specified interpreter.ssh - Support for parallel (asynchronous) command execution.
-
connection manager with host availability check.ssh - Support for directory navigation.
- Combined access to remote hosts by key and/or password.
- Error handling when using commands that require user input.
- Support for storing and reusing passed variables and functions (the
command clears the history).exit
Launch
You can download the pre-compiled executable from the releases page and run the bot locally or in a Docker container using the image from Docker Hub.
Note
Before launching, you need to create your Telegram bot using @BotFather and get its
, which must be specified in the configuration file.API Token
- Create a working directory:
- Create and fill the
file file inside the working directory:.env
Note
Access to the bot is limited by user ID. You can find out the Telegram
using @getmyid_bot or in the bot logs when sending a message to it.id
- Run the bot in a container:
Note
The bot environment is not stored in an image, but uses a mounting mechanism. To access remote hosts using a key, you need to forward the private key file from the host system to the container (as in the example above) and leave the contents of the
variable empty.SSH_PRIVATE_KEY_PATH