How can I open a 'shell' channel to a connected ssh client using apache sshd from sshserver. RFC 4254 mentions
When either side wishes to open a new channel, it allocates a local number for the channel
which means the server can also open a channel to client.
But I do not see any API on org.apache.sshd.server.session.ServerSession
..? Am I missing something..? My requirement is to asynchronously send messages to sshclient from sshserver.
The SSH2 protocol was designed to be extensible in case there will be some use case for something like this. But it was not yet the case and there are not channels that could be initiated from the server side.
Therefore even if there would be such request, it would be invalid in most of the clients, as you can see when you search through the OpenSSH code:
packet_start(SSH2_MSG_CHANNEL_OPEN);
creates a new channel from client sidedispatch_set(SSH2_MSG_CHANNEL_OPEN, &server_input_channel_open);
assigns handler for this message in server.There is nothing like that the other way round so it would be ignored or cause a error.