I need to ssh to debian server and then from this server telnet to other (cisco) devices, run some commands and read response.
I’ve started writing C# application to connect to ssh server (using SSH.NET library), but how should I continue with telneting from this server?
Should I write C or Perl program that would telnet to device and I would execute this program remotely? Isn’t there any easier way like bash script? Or maybe asynchronous ssh connection that would allow me to execute telnet program on debian server and control it remotely?
As SSH allows tunnelling, perhaps you could initiate the SSH session, create a tunnel for the telnet part and then you could issue the telnet commands from the same C# program through the tunnel to the Cisco devices.
If you decide to go with this approach, this question about .Net Telnet libraries might be useful