I want to write an application that would be a custom SSH server with two types of connection:
- A sync channel, where clients type a command and the server would return the output
- An stream channel where the user connects and starts reading the IO, the server publishes data continuously.
I am doing that in Java, I think Apache Mina SSHD in the right tool for that. I managed to write some code for authentication (thanks to resources found on the net) and could run the /bin/sh on my connection so I am all setup I guess. The problem is that from now I am stuck, due to lack of knowledge on how these things works and how Mina works specifically.
Basically I would need to have access to the input and output stream for each SSH connection, after that I can sort out things on my own, buy what's the right way to get that?
Should I make a custom Channel ? A custom Shell ? A custom set of commands ?
Could any one point me to resources on the subject ?