opentunnel-connect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenTunnel Connect Skill

OpenTunnel Connect 技能

Connect to remote servers behind NAT using reverse SSH tunnel.
使用反向SSH隧道连接NAT后的远程服务器。

Flow

流程

Step 1: Ask Options

步骤1:询问选项

Ask user:
  • Username? (default: tunneluser)
  • Minutes? (default: 60)
向用户询问:
  • 用户名?(默认值:tunneluser)
  • 时长(分钟)?(默认值:60)

Step 2: Execute Binary

步骤2:执行二进制文件

powershell
powershell.exe -Command "& 'C:\Users\Julian\.config\opencode\skills\opentunnel-connect\opentunnel.exe' --user USERNAME"
The binary will:
  1. Read/create SSH key from ~/.ssh/
  2. Output curl command for remote server
  3. Wait for user to input tunnel info
powershell
powershell.exe -Command "& 'C:\Users\Julian\.config\opencode\skills\opentunnel-connect\opentunnel.exe' --user USERNAME"
该二进制文件将:
  1. 从~/.ssh/读取/创建SSH密钥
  2. 输出供远程服务器使用的curl命令
  3. 等待用户输入隧道信息

Step 3: User Runs Command

步骤3:用户执行命令

Give curl command to user to run on remote server.
Example:
bash
curl -fsSL "https://raw.githubusercontent.com/julianponguta/opentunnel/main/connect.sh?v=$(date +%s)" | sudo bash -s -- 60 root "ssh-ed25519..."
提供curl命令给用户,让其在远程服务器上运行。
示例:
bash
curl -fsSL "https://raw.githubusercontent.com/julianponguta/opentunnel/main/connect.sh?v=$(date +%s)" | sudo bash -s -- 60 root "ssh-ed25519..."

Step 4: Get Tunnel Info

步骤4:获取隧道信息

User must provide:
bore.pub:PORT
用户必须提供:
bore.pub:PORT

Step 5: Connect with ezssh

步骤5:使用ezssh连接

javascript
ezssh_ssh_execute({
  command: "hostname && uptime",
  hosts: ["bore.pub"],
  port: PORT,
  username: "USERNAME",
  privateKeyPath: "C:/Users/Julian/.ssh/id_ed25519"
})
javascript
ezssh_ssh_execute({
  command: "hostname && uptime",
  hosts: ["bore.pub"],
  port: PORT,
  username: "USERNAME",
  privateKeyPath: "C:/Users/Julian/.ssh/id_ed25519"
})

Quick Install (for users)

快速安装(面向用户)

Users can install on their servers:
bash
echo 'ot() { curl -fsSL "https://raw.githubusercontent.com/julianponguta/opentunnel/main/connect.sh?v=$(date +%s)" | sudo bash -s -- "${@:-60}"; }' >> ~/.bashrc && source ~/.bashrc
Then just run:
ot 60 root
用户可在其服务器上安装:
bash
echo 'ot() { curl -fsSL "https://raw.githubusercontent.com/julianponguta/opentunnel/main/connect.sh?v=$(date +%s)" | sudo bash -s -- "${@:-60}"; }' >> ~/.bashrc && source ~/.bashrc
之后只需运行:
ot 60 root