I am trying to send commands to a server via SSH or telnet. Basically whichever is easier to accomplish at the moment. At my job I work with an inventory system that is text and menu based and I connect to it via telnet or ssh. I want to create a nice c++ front end to do certain tasks with and add extra functionality. My thought process thus far:
1) Can I open ssh/telnet via c++? So far yes, ssh on a linux box. Telnet on window.
2) Can I send actual commands to the session I open? I know it should be possible (i am sure some ssh client are written in c++) but I am not sure the best way to approach this. I am considering using piping and an external ssh client but once the connection is open how can I send a command? i.e. "2 enter" to get to option 2 of a menu.
3) Is there a better way to send commands than in plain english? Is there a way to see thru logging or something how the server recognizes my commands? Meaning, if I am at the main menu and want option #2 I usually hit "2 enter" but I am sure the program I am working with interprets this differently. Is there a way to see how it interprets it without viewing the source?
I know this was a lot of questions and such to ask but I am trying to get a grasp on what is possible, what is feasable, and what is within my abilities.
Thanks