SSH-Tunnel 安装指南

一个入口完成首次安装,后续统一在管理页升级。

首次安装

一键安装脚本会识别 Windows、macOS、Linux 的平台与架构,下载对应的服务版二进制,并在安装过程中交互采集首装所需的最小配置。

Linux / macOS

curl -fsSL https://idefav.github.io/ssh-tunnel/install | sh

Windows PowerShell

irm https://idefav.github.io/ssh-tunnel/install | iex
Windows 请使用管理员 PowerShell;Linux / macOS 默认需要 sudo 才能写入系统目录和注册服务。

安装器行为

  • 首次安装时会采集 server.ipserver.ssh.portlogin.usernamessh.private_key_path
  • 会询问服务监听范围,并据此生成 local.addresshttp.local.addressadmin.address
  • 会先检查私钥文件是否存在,并在默认端口冲突时要求输入新端口。
  • 会下载最新 Release 的目标资产与 SHA256SUMS,校验成功后再写入磁盘和注册服务。
  • 默认配置为 socks5.enable=truehttp.enable=falseadmin.enable=true、自动更新开启。
如果检测到已有安装、已有服务或已有配置,安装器不会覆盖现有文件,而是提示你去管理页的版本页面完成更新。

落盘与服务布局

平台 二进制 配置 服务标识
Windows C:\ssh-tunnel\ssh-tunnel-svc.exe C:\ssh-tunnel\.ssh-tunnel\config.properties SSHTunnelService
Linux /usr/local/bin/ssh-tunnel /etc/ssh-tunnel/config.properties ssh-tunnel.service/etc/init.d/ssh-tunnel
macOS /usr/local/bin/ssh-tunnel /etc/ssh-tunnel/config.properties /Library/LaunchDaemons/com.idefav.ssh-tunnel.plist

手动安装服务时,也请沿用上面的服务名和路径,这样管理页中的重启和升级逻辑才能准确识别当前平台服务。

配置示例

下面是与当前程序实现一致的规范配置键示例:

home.dir=/var/lib/ssh-tunnel
server.ip=your-ssh-server
server.ssh.port=22
ssh.private_key_path=/path/to/id_rsa
login.username=root
local.address=127.0.0.1:1081
http.local.address=127.0.0.1:1082
http.enable=false
socks5.enable=true
http.over-ssh.enable=false
http.domain-filter.enable=false
http.domain-filter.file-path=/var/lib/ssh-tunnel/domain.txt
admin.enable=true
admin.address=127.0.0.1:1083
log.file.path=/var/log/ssh-tunnel.log
auto-update.enabled=true
auto-update.owner=idefav
auto-update.repo=ssh-tunnel
auto-update.current-version=v0.0.0
auto-update.check-interval=3600

后续更新

一键安装只用于首装。升级现有实例时,请打开管理页面版本页:

http://127.0.0.1:1083/view/version

如果安装时自定义了管理端口,请使用当前 admin.address 对应的地址访问版本页。