sshnet / sshnet/SSH.NET

Issues running commands in a separate shell

Aperta
#248 0 commenti 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

Hello,

We are writing a C# app that needs to talk to a system running Dropbear SSH running on ARM.

We cannot use the SSH.Net RunCommand() API directly because the system requires a separate shell - due to security concerns.
Attempting to use RunCommand, the call just hangs and eventually times out.

So, we are now calling CreateShellStream() and then using ReadStream() and WriteStream() to send commands via the Shell.

This seems to work somewhat ok, but we have some concerns:
(1) Performance - after calling WriteStream(), we are calling stream.Expect()
to know when the command is complete so we can look at the results
This is noticeably slower than calling the same commands manually from a PuTTY session -
is there a better way to handle this?
(2) Command Result Processing - not clear if a command succeeds or not
after we read the output stream, we have the text from stdout,
but we have to manually parse it to see if we think the command succeeded or not
is there any way to get the command result as an integer (0 meaning success)?

thanks for any suggestions -dennis

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

Iniziare esaminando gli entry point RunCommand(), CreateShellStream(), ReadStream(), WriteStream() ed Expect() menzionati nel report. Determinare se il workflow con una shell separata può esporre lo stato di uscita dei comandi ed evitare il ritardo segnalato; l’issue non indica file o test, quindi è necessario chiarire l’ambito e i criteri di completamento.

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

Valutazione

Stack tecnologico
csharp
Ambito
networking
Tipo di issue
Funzionalità
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.