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

Offen
#1,862 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
12/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
csharp
Bereich
networking, security

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
Vorherrschende Sprache
C#
Sterne
4.4k
Forks
987
Ø Merge
2 T. 6 Std.
Gemergte PRs (30 T.)
4

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus sshnet/SSH.NET

Alle Issues in sshnet/SSH.NET

Ähnliche Issues

Weitere Issues zu C#

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.