c++ how to ssh to a server and automate task ?

Hi guys,

at the place where I work, we use Tera Term (macros) to automate tasks. I'm learning C++ and I was wondering if I could use C++ to automate boring task the same way we do with Tera Term so I can have fun learning c++ solving real problems. For this, I would need to be able to create a program on visual studio that can ssh to a server send a command and wait for an output from the computer.

example:

cout << please enter an ip address for the server you would like to connect
cin >> ssh ip@10.17.5
// I don't know how to ssh from windows while writing code in visual studio.
//in Linux we would do "ssh test@10.12.17.5:"
once login I would like to send commands to the computer like a person would be typing it and wait for an output and validate that output.


This is the wepside of the tera term we use http://ttssh2.osdn.jp/

Thanks to everyone in advance.
Last edited on
You could, but you would be much happier using Expect.
http://expect.sourceforge.net/
Hope this helps.
Topic archived. No new replies allowed.