net::ssh::Perl connecting to f-secure ssh server
am 10.10.2007 10:07:30 von Tweetie PoohHi,
I asked this on the wonderful Perlmonks site and am repeating here incase
the one with the answer is here and not there....
We need to write a script that will connect to a softswitch (Ericsson),
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',debug=>'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.
I am using Protocol 2 (only), 1 doesn't even log in.
I have cobbled something similar in Java and get similar results, ie I
login, sometimes see the prompt but that's it.
Note that I am effectively connecting to an application rather than a
true shell.