> For the complete documentation index, see [llms.txt](https://xn--6o0a585a.gitbook.io/devops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xn--6o0a585a.gitbook.io/devops/telegram-ji-qi-ren/node-yuan-cheng-zhi-xing-shell-ming-ling.md).

# node远程执行shell命令

TeleShellBot

### 教程

**Github地址：**<https://github.com/marknote/TeleShellBot>

**1、安装**

```
git clone https://github.com/marknote/TeleShellBot.git
cd TeleShellBot
npm install
```

`git`和`npm`安装请参考：[Debian/Ubuntu/CentOS安装最新版的Node.js和NPM教程](https://www.moerats.com/archives/328/)，[Debian/Ubuntu/CentOS安装Git教程](https://www.moerats.com/archives/216/)。

**2、配置**\
根据[Telegram instructions](https://telegram.org/blog/bot-revolution)去创建一个机器人的`UserID`，然后将`UserID`和`BOT token`放到`config.js`里面。

```
module.exports = {
    config:function(){
        return (
            {
                adminUsers:[ADMIN_ID], //admin users' telegram id, should be numbers
                botToken: 'YOUR_BOT_TOEKN', // bot token

            }
        );
    }
};
```

**3、运行**

```
npm start
```

or

```
node index.js
```

**原文地址：**<https://www.v2ex.com/t/394208>
