0 votes
by (120 points)

We are using Compact 2013 and are trying to get an ssh server working on it. one probel we are coming across is running external apps via the ssh serve and capturing the stdin and stdout.

Does anyone have a solution or any suggetions



1 Answer

0 votes
by (136k points)

This is possible, but some parts of this scenario have to be custom-implemented (this is not a primary purpose of Rebex File Server).

To make this work, you have to register a custom command using FileServer object's ShellCommand event and use the command's SshConsole's GetInputStream() (corresponds to stdio), SshConsole.GetOutputStream() (corresponds to stdout) and SshConsole.GetErrorStream() (corresponds to stderr).
http://forum.rebex.net/6863/ssh-exec-program to pass data to/from an external process.

We have sample code that demonstrates running an external command line app. However, this would have to be modified slightly to target Compact 2013 because it utilizes .NET 4.0's Task class to run background methods to pass data between Rebex File Server and the external app.