Support SSH connections over direct-tcpip channels without a local TCP listener

未关闭
#1,862 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
12/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
csharp

调研方向

The request concerns the port-forwarding and channel code in the SSH.NET library, where ForwardedPortLocal currently opens a local listener. Start by reading how direct-tcpip channels are opened and how SshClient and SftpClient establish their transport. Done would be a public API that connects a target client through an existing jump-host session without a listener, with tests covering per-hop authentication and cancellation. This is design work with no comments yet.

由索引模型根据 Issue 内容生成。

描述

Problem

We use SSH.NET 2026.0.0 for SSH and SFTP connections through jump hosts.

Our current implementation connects to the jump host, starts a ForwardedPortLocal on an ephemeral loopback port, and connects the target SshClient or SftpClient through that port.

The local listener remains accessible to other local processes for the lifetime of the connection. Those processes still need to authenticate to the target, but they gain network access through the application's authenticated jump-host connection.

Stopping the forwarded port also closes its active channels, so calling Stop() after the target handshake does not solve this.

Requested capability

Provide a supported public API for connecting SshClient and SftpClient through an authenticated jump-host connection without creating a local TCP listener.

Possible API directions:

  • Native jump-host support.
  • Exposing a direct-tcpip channel as a duplex transport, with a way to connect an SSH client over that transport.

These are suggestions; we would welcome an approach that fits SSH.NET's architecture.

Required behavior

  • Preserve independent authentication and host key verification for each hop.
  • Support password, private key, and externally supplied agent-backed authentication methods.
  • Support cancellation during channel opening and target connection establishment.
  • Keep the channel operational throughout
主要语言
C#
星标
4.4k
派生
987
平均合并
2 天 6 小时
30 天内合并 PR
4

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sshnet/SSH.NET 的其他 Issue

查看 sshnet/SSH.NET 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。