I am working on a Windows version of a server application that communicates with a web application. The web application originally worked with a Linux server, and would SSH into Linux to execute commands on the server. My plan is to build a C++ server using Qt to receive commands from the web application, and process them to do the windows version of what those commands are.
So for example, if the web application originally sent "echo $HOME" and received back the home directory, I want to receive that same SSH command on my Windows server, then process it so if the server was configured for the home directory to be C:\Example\, then it would send back C:\Example\. My goal is to make as little change to the web application, and instead have the Windows server process the Linux SSH commands to do the Windows equivalent.
I've never worked with libssh before, but from some searching I found it and read that it could be used as an SSH2 server. Basically my question here, is how would I use libss2 to create a server in my Qt project to allow this web application to SSH in and send commands.
If you think there is a better way then libssh please let me know, this is just what I have found through searching.
UPDATE: I found this code of a server example. https://github.com/substack/libssh/blob/master/examples/samplesshd-tty.c
Honestly, I'm very confused by it. I'll probably be able to break it down and understand what's happening after a few hours of Googling and working through the code. But If anyone would be willing to walk me through main explaining what's happening at each step, that would be appreciated.