展示 HN:用于 SSH 端口转发的 macOS 菜单栏管理器
Show HN: macOS menu-bar manager for SSH port forwards

原始链接: https://github.com/lx2026/RelayBar

RelayBar 是一款轻量级的 macOS 菜单栏实用工具,专为管理本地 SSH 端口转发而设计。它作为系统内置 `/usr/bin/ssh` 的用户友好型外壳,支持用户通过单击即可轻松启动、停止和监控隧道。 主要功能包括: * **简化管理**:支持导入常用 SSH 命令、手动配置,以及自动打开本地 URL 的浏览器页面。 * **稳健连接**:包含针对意外断开连接的自动重试逻辑,并采用指数退避算法。 * **原生集成**:读取现有的 `~/.ssh/config`,利用 SSH Agent,并遵循 `known_hosts` 文件。 * **安全优先**:避免调用 Shell,并拒绝不安全的 SSH 选项(如执行本地命令或写入日志等),以维护安全环境。 RelayBar 特意采用非沙盒(non-sandboxed)模式,以充分发挥系统 SSH 的完整能力。该软件通过 Mac App Store 以外的渠道分发,要求 macOS 13 或更高版本以及 Xcode 命令行工具。该项目为开源软件,并为希望自行编译的开发者提供了简单的构建与公证脚本。

Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Show HN:macOS 菜单栏 SSH 端口转发管理器 (github.com/lx2026) 6 分,linxy97 发布于 1 小时前 | 隐藏 | 过往 | 收藏 | 讨论 这是一个用于本地 SSH 端口转发的轻量级原生 macOS 菜单栏应用。它没有任何外部依赖,且为原生运行。 帮助 考虑申请 YC 2026 年秋季班!申请截止日期为 7 月 27 日。 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

RelayBar is a tiny native macOS menu-bar app for local SSH port forwards. It has no external dependencies and runs macOS's built-in /usr/bin/ssh directly.

Download the latest release

RelayBar tunnel list RelayBar new tunnel form

  • Imports common commands such as ssh -N -L 8080:localhost:3000 user@host
  • Adds tunnels manually with five small fields
  • Starts and stops each tunnel with one click
  • Starts a tunnel and opens its local URL in the default browser with one click
  • Retries unexpected disconnects up to 10 times with exponential backoff
  • Shows startup failures directly beside the tunnel
  • Stores tunnel definitions in local UserDefaults
  • Stops child SSH processes when RelayBar quits

RelayBar intentionally manages one local (-L) forward per item. Safe connection options such as -p, -J, -i, and a restricted set of -o values are preserved when importing a command. Options that can execute local commands, select arbitrary configuration files, or write logs are rejected. RelayBar never invokes a shell.

RelayBar is distributed outside the Mac App Store and is intentionally not sandboxed. Its SSH process behaves like the command-line client: it reads the user's normal ~/.ssh/config and known_hosts, can use configured identity files, and inherits access to the user's SSH agent. SSH still runs non-interactively, so password prompts are not supported. On recent macOS versions, the first connection to a .local or LAN host may ask for Local Network access.

The concise architecture and behavior archive starts at docs/system-specs.

Requires macOS 13 or newer and the Xcode command-line tools.

./scripts/build-app.sh
open .build/RelayBar.app

The packaged app is written to .build/RelayBar.app. The build script automatically finds the first valid Developer ID Application certificate in the login keychain and signs with the hardened runtime.

To create a signed ZIP:

./scripts/package-release.sh

This writes .build/RelayBar.zip. A Developer ID signature identifies the publisher, but a downloaded app should also be notarized to pass Gatekeeper without warnings. After storing one notarytool keychain profile, notarize and staple with:

xcrun notarytool store-credentials relaybar-notary \
  --apple-id YOUR_APPLE_ID \
  --team-id YOUR_TEAM_ID \
  --password YOUR_APP_SPECIFIC_PASSWORD

NOTARY_PROFILE=relaybar-notary ./scripts/notarize-release.sh

Set SIGNING_IDENTITY only when a Mac has multiple Developer ID certificates and the automatic choice is not the one you want.

联系我们 contact @ memedata.com