Hi monks

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.

#!/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");
Gives lots of debug info showing attempt to use key files etc all fail (OK) then using password. I get a login completed.
prospero: 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
Then it waits. If I press ENTER
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
Ideas much appreciated.

I don't need a great deal of fancy stuff. The commands and output are pretty fixed, no real nasties like running passwd.


In reply to net::ssh::Perl connecting to f-secure ssh server by tweetiepooh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.