中文交互向导:ssh-tunnel 无参数进入,装完自动进入,填完直接运行

- 向导:选/建主机(实时连通测试,可重试)→ 选/建隧道(端口智能默认)→ 立即前台运行
- install.sh 结尾 exec 进入向导(stdin 从 /dev/tty 读,兼容 curl|bash)
- cli.py 抽出 run_foreground 供 start 与向导复用;修复向导新建隧道分支不可达
This commit is contained in:
leefer
2026-09-27 20:15:21 +08:00
parent 06c57dfbd1
commit 078b272eb1
7 changed files with 270 additions and 29 deletions
+8 -5
View File
@@ -16,6 +16,9 @@ powershell -c "irm https://gitea.xbay.cc/leefer/ssh-e2e/raw/branch/main/install.
curl -fsSL https://gitea.xbay.cc/leefer/ssh-e2e/raw/branch/main/install.sh | bash
```
安装完成会**自动进入中文配置向导**:按提示输入 SSH 地址、密码、远程端口等
(直接回车采用方括号里的默认值),填完隧道立即建立,Ctrl+C 断开。
## 典型场景
远程主机上有个服务只监听它自己的 `127.0.0.1:3000`,公网访问不到。
@@ -24,12 +27,12 @@ curl -fsSL https://gitea.xbay.cc/leefer/ssh-e2e/raw/branch/main/install.sh | bas
## 命令行用法(Linux/macOS,Windows 亦可 `python cli.py`)
```bash
ssh-tunnel host add 我的服务器 root@1.2.3.4 # 添加主机(交互输入密码;私钥加 --key ~/.ssh/id_rsa)
ssh-tunnel test 我的服务器 # 测试连通与认证
ssh-tunnel tunnel add web --host 我的服务器 --lp 3000 --rp 3000
ssh-tunnel start web # 前台运行,Ctrl+C 断开
ssh-tunnel list # 查看全部
ssh-tunnel # 交互向导:选已有主机/隧道或新建,建好直接运行
ssh-tunnel start web # 直接启动某条已配置的隧道(前台,Ctrl+C 断开)
ssh-tunnel list # 查看全部
ssh-tunnel test 我的服务器 # 测试主机认证
ssh-tunnel remove tunnel web
ssh-tunnel --help # 完整参数(host add / tunnel add 等)
```
## 图形界面(Windows)