A simple Telegram bot that allows authorized users to execute predefined shell commands remotely.
- Install dependencies:
pip install -r requirements.txt
- Copy
config.example.pytoconfig.pyand update the values:cp config.example.py config.py
- Set
APP_NAMEto your bot's name. - Replace
BOT_TOKENwith your Telegram bot token. - Update
ALLOWED_USERSwith Telegram user IDs allowed to use the bot.
- Set
- The bot listens for text messages from authorized users.
- Allowed commands:
ls,uptime,df,top,whoami - Unauthorized users will be denied access.
- Output is truncated if it exceeds 4000 characters.
python bot.py- Only predefined commands can be executed.
- User authentication is enforced through
ALLOWED_USERS. - Do not allow unrestricted command execution to prevent security risks.
Use this bot at your own risk. The author provides no warranty or liability for any potential issues or misuse. This project is intended for demo purposes only.
This project is licensed under the MIT License.