sshnet / sshnet/SSH.NET

Exception "Session operation has timed out" upon connect to some hosts

Offen
#722 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
C#
Sterne
4.4k
Forks
993
Ø Merge
9 T. 21 Std.
Gemergte PRs (30 T.)
1

Beschreibung

I'm having a really odd occurrence and I've troubleshooted back to this library - or a combination of factors, including this library.

SSH.NET is working great to hundreds of devices behind multiple firewalls - but! I have a handful of devices behind a specific firewall that I'm trying to establish SSH sessions to. I can fire up putty and SSH to any one of them fine (all defaults, from the same source host), yet when I attempt to connect with SSH.NET I get the following exception (on the .Connect() line);

Error Message
Session operation has timed out

Stack Trace

   at Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle, TimeSpan timeout)
   at Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle)
   at Renci.SshNet.Session.Connect()
   at Renci.SshNet.BaseClient.Connect()
   at test.Ssh.Client.Connect() in C:\Users\dev\source\test\Ssh.vb:line 59

Increasing the timeout makes no difference, besides, Putty connects instantly. User/pass makes no diff if right or wrong, error is the same.

Is there any way to get any debug logging out of SSH.NET?

Any other ideas?

Basic Code to Re-Produce

Imports Renci.SshNet
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
        Dim cl As New SshClient("172.16.0.2", "test.user", "test.pass")
        Try
            cl.Connect()
        Catch ex As Exception
            Debug.WriteLine(ex.Message)
        End Try
    End Sub
End Class

This code will probably work fine when you test it - because it does for nearly all my hosts too - just these select few!

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der gemeldeten VB-Reproduktion in Ssh.vb, Zeile 59, und verfolge Renci.SshNet.BaseClient.Connect über Session.Connect bis zu Session.WaitOnHandle. Vergleiche die fehlschlagenden Hosts mit den funktionierenden PuTTY-Verbindungen und ermittle, ob SSH.NET nützliche Debug-Protokollierung oder eine spezifische Ursache für das Timeout offenlegen kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
networking
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

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