Skip to content

[[Feature] 支持 ssh_config 的 RemoteForward(2.3.1 内建 SSH 仍只支持 LocalForward) #830

Open

Description

@Alemax067

Problem / pain point — 现在的痛点

Pebrel 2.3.1(当前最新版,Linux)的内建 SSH 仍然忽略 ~/.ssh/config 里的 RemoteForward(反向端口转发),且不提示。

复现:

  1. ~/.ssh/config:
    Host sshserver
    HostName ...
    RemoteForward 7890 127.0.0.1:7897
  2. 系统 ssh sshserver → 服务器 127.0.0.1:7890 正常监听,隧道可用。
  3. Pebrel 2.3.1 打开同一主机 → 服务器没有 7890;依赖该隧道的 ssh -T git@github.com 失败:
    kex_exchange_identification: Connection closed by remote host

ssh -G sshserver 能展开出 remoteforward 7890 [127.0.0.1]:7897,但 Pebrel 解析时只保留 hostname/user/port/identityfile/proxyjump,转发项被丢弃。

源码确认(tag v2.3.1):只有 LocalForward(nebula_app/src/ssh_session/forward.rs、Ports UI),全仓库搜不到 RemoteForward / remote_forward。

影响:依赖反向隧道的场景(把本机代理暴露给远端、远端服务回调本机等)在 Pebrel 内建 SSH 中不可用,只能退回系统 ssh。

Proposed solution — 希望的做法

解析并应用 RemoteForward [bind_address:]port host:hostport(支持多条、IPv6),在会话生命周期内通过 russh 请求服务端转发,断开时清理。可复用现有 forward.rs / Ports UI,增加 remote 类型。暂不支持的写法(Unix socket 等)至少给出明确警告,不要静默忽略。

Alternatives considered — 现在的替代办法

用系统 ssh 常驻一个 ssh -N mmagenta100 隧道,或该主机改用终端 ssh;可行,但绕开了内建 SSH 的工作流。

Platform / 平台

Linux

Related area / 相关范围

SSH / proxy / jump host — SSH、代理、跳板

How important is this to you? / 对你有多重要

Would improve my daily workflow / 每天都会用到

Before submitting / 提交前确认

  • I searched existing issues for similar requests / 已搜索,无重复

Activity

  1. added
    enhancement新功能或改进 / new feature or request
    triage待维护者初审 / not yet reviewed
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: sshSSH 连接、主机管理、密钥、代理/跳板enhancement新功能或改进 / new feature or requestos: linux仅 Linux 桌面triage待维护者初审 / not yet reviewed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions