sshnet / sshnet/SSH.NET

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

Aperta
#722 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C#
Stelle
4.4k
Fork
993
Merge medio
9g 21h
PR unite (30g)
1

Descrizione

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!

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la riproduzione segnalata in VB alla riga 59 di Ssh.vb e segui Renci.SshNet.BaseClient.Connect attraverso Session.Connect e Session.WaitOnHandle. Confronta gli host che falliscono con le connessioni PuTTY funzionanti e determina se SSH.NET può esporre registrazioni di debug utili o una causa specifica del timeout.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
networking
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.