Skip to content

用next-terminal来管理远程主机的网关 – 支持ssh/rdp/vnc等等

Tags:

参考

github原文:https://github.com/dushixiang/next-terminal

类似之前玩过的guacamole+guacd+mysql实现远程vnc – 本馆档案

安装 – 原始安装文档链接

####!!! 已经失效 2021-10-14
# 这个命令的好处是可以保持记录的持续性 - 备份只要拷贝next-terminal.db就行了

docker run -d \
  -p 9051:8088 \
  -v $(pwd):/db \
  -e DB=sqlite \
  -e SQLITE_FILE='/db/next-terminal.db' \
  --name next-terminal \
  --restart always \
  dushixiang/next-terminal:latest


### 2021-10-14
mkdir -p /data/next-terminal && cd /data/next-terminal
vi docker-compose.yml #并写入下面
version: '3.3'
services:
  guacd:
    image: dushixiang/guacd:1.3.0
    volumes:
      - ./data:/usr/local/next-terminal/data
    restart:
          always
  next-terminal:
    image: dushixiang/next-terminal:latest
    environment:
      DB: sqlite
      GUACD_HOSTNAME: guacd
      GUACD_PORT: 4822
    ports:
      - "9051:8088"
    volumes:
      - /etc/machine-id:/etc/machine-id
      - /etc/localtime:/etc/localtime
      - ./data:/usr/local/next-terminal/data
    restart:
      always


docker-compose up -d
docker logs -f next-terminal

默认账号密码为 admin/admin

反代

一定要加上这段 – 不然无法连接

   proxy_pass http://127.0.0.1:9051;
    
    proxy_buffering     off;
    proxy_http_version  1.1;
    proxy_set_header    X-Real-IP $remote_addr;
    proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header    Upgrade $http_upgrade;
    proxy_set_header    Connection $http_connection;
    access_log          off;
        
    proxy_set_header Host $host;
    proxy_set_header REMOTE-HOST $remote_addr;

试验

RDP

据说还可以批量执行命令

Leave a Reply

Your email address will not be published.