❔ SSH.Net trying to build a interactive shell
I am trying to build a ssh terminal in C#, but i am not able to output text from the streams (the code is a melting pot of pieces, and currently following a similar project): I notice that i need to write something back to able to "refresh" the output stream.
CODE in comments
8 Replies
(The environment runs in local network)
when i don't write anything in the "input shell" stream
there is some mess in this code
if you are using
_reader
like that you wouldn't really need it, since _shellStream
already has ReadAsync
(also im pretty sure vs is giving you some hints on that to use a different overload)
then when write you are not using async version
and then you are using Thread.Sleep
instead of Task.Delay
also i would not call CreateShellStresm
in a constructor because it's sending data, so it could throw exceptions (it's not great, i know)
having said this, i tried to use ssh.net in the beginning and was not satisfied
so then i tried to use plink instead
then tried ssh.net and it started working for me, tho' i admit it's not the best code i have seentake a look for this github project https://github.com/AMuhaimin/sshTerminal
GitHub
GitHub - AMuhaimin/sshTerminal: Simple SSH Terminal dari c#
Simple SSH Terminal dari c#. Contribute to AMuhaimin/sshTerminal development by creating an account on GitHub.
why on earth there is a nupkg committed in the folder
i dont know )
i copied some code from others xd
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.