This has to fall in the "dumb question" category, but I've spent a lot of time trying to figure it out without success. (Surely I'll get it as soon as I post this...)
I successfully created a simple SSH server test app. When TScSSHServer gets a client connection (with a shell request) it connects it directly to a CMD shell.
How do I instead make it so that the client can interact with my server application instead of a CMD shell?
Based on my understanding of the documentation, I tried setting DIRECT in the BeforeChannelConnect event but it doesn't seem to make any difference; behavior seen by client is unchanged, and my OnDataFromClient event handler isn't called.
How to connect the SSH server to my app instead of a CMD shell
Re: How to connect the SSH server to my app instead of a CMD shell
When setting the Direct property to True in the TScSSHServer.BeforeChannelConnect event handler, a direct channel will be established for communication between the client and the server only when using port forwarding and will not work when using the shell.
To solve your task, you can use port forwarding and set the Direct property to True in the TScSSHServer.BeforeChannelConnect event handler.
To solve your task, you can use port forwarding and set the Direct property to True in the TScSSHServer.BeforeChannelConnect event handler.
Re: How to connect the SSH server to my app instead of a CMD shell
Thanks for the response, Viktor. Now when you say "port forwarding", I visualize SSH tunnels (e.g. OpenSSH client uses "-L" / "-R" options to proxy data for other apps), which isn't what I'm talking about at all, so let me clarify.
Right now, when someone types "ssh my_server" (which connects them to TScSSHServer) and authenticates, they're instantly taken directly to an interactive Windows CMD prompt.
What I want to happen instead is that when someone types "ssh my_server" and authenticates, they're then talking to me (meaning my Delphi application that's using TScSSHServer and executes my logic to parse incoming commands from the client and reply to them.)
Right now, when someone types "ssh my_server" (which connects them to TScSSHServer) and authenticates, they're instantly taken directly to an interactive Windows CMD prompt.
What I want to happen instead is that when someone types "ssh my_server" and authenticates, they're then talking to me (meaning my Delphi application that's using TScSSHServer and executes my logic to parse incoming commands from the client and reply to them.)
Re: How to connect the SSH server to my app instead of a CMD shell
When using port forwarding, the TScSSHServer.BeforeChannelConnect event handler is designed for the Devart SSH Sever bundle with the Devart SSH Client client. We will add the ability to use the TScSSHServer.BeforeChannelConnect event handler for the Devart SSH Sever bundle with the OpenSSH shell in the next build.
Re: How to connect the SSH server to my app instead of a CMD shell
When the next build will be released? Since the last version has been 4 months. Thanks
Re: How to connect the SSH server to my app instead of a CMD shell
The new SecureBridge release is planned to release within one week.
You can follow the news about SecureBridge releases in the at http://www.devart.com/news.
You can follow the news about SecureBridge releases in the at http://www.devart.com/news.