Closed
Description
By default you can't write to the Standard Input of a running SshCommand
and can only write to a process running in SSH by using CreateShellSession
. This causes a few problems in my use-case (sending protobuf-formatted packets back and forth):
- The input is mirrored back in the output, useful in an interactive context but not for automation
- Sending arbitrary binary data can cause problems (like accidentally sending
\u001b
which is escape in UTF16 or similar) - A newline needs to be sent in order to actually commit input to the program
I've created a workaround for this that uses evil reflection hacks for sending stuff directly to SshCommand
.
Proposed changes
- Expose
IChannelSession
,IChannelSession
andSshCommand._channel
as public
or
- Add a public method to
SshCommand
that calls_channel.SendData(byte[] data, int offset, int size)
I could create a PR for either solution, although I'm not sure yet how I would write a test for this.
Metadata
Metadata
Assignees
Labels
No labels