tweetiepooh has asked for the wisdom of the Perl Monks concerning the following question:
We need to write a script that will connect to a softswitch (telco), run commands retrieving output to files and sometimes using some of that output as parameters to more commands.
The softswitch runs on Windows NT server and uses F-Secure 3.2.0. The client box will be Solaris with Perl 5.8.8.
I can run ssh from the shell and connect OK. I can run the commands and see output on screen.
I have started to write a demo in Perl and I can login fine, using ssh->shell() I can see the post login welcome and the "shell" promp (oddchar + <). If I go interactive I can see my input on the screen but no response from server. If I send commands I get an error.
Gives lots of debug info showing attempt to use key files etc all fail (OK) then using password. I get a login completed.#!/usr/local/bin/perl -w use strict; use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new("host",(protocol=>'2',port=>'52000',debu +g=>'true')); $ssh->login("user","pass"); $ssh->cmd("exit");
Then it waits. If I press ENTERprospero: Next method to try is password. prospero: Trying password authentication. prospero: Login completed, opening dummy shell channel. prospero: channel 0: new [client-session] prospero: Requesting channel_open for channel 0. prospero: channel 0: open confirm rwindow 100000 rmax 16384 prospero: Got channel open confirmation, requesting shell. prospero: Requesting service shell on channel 0. prospero: channel 1: new [client-session] prospero: Requesting channel_open for channel 1. prospero: Entering interactive session. prospero: Sending command: exit prospero: Requesting service exec on channel 1. prospero: channel 1: open confirm rwindow 100000 rmax 16384
Ideas much appreciated.Received disconnect message: Window overflow received channel data. at /usr/local/lib/perl5/site_perl/5.8.8/Net/SSH/Perl/SSH2.pm line 284
I don't need a great deal of fancy stuff. The commands and output are pretty fixed, no real nasties like running passwd.
|
|---|