Click here to get back home

net::ssh::Perl connecting to f-secure ssh server

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
net::ssh::Perl connecting to f-secure ssh server Tweetie Pooh 10-10-2007
Posted by Tweetie Pooh on October 10, 2007, 4:07 am
Please log in for more thread options
Hi,

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.

Posted by Tweetie Pooh on October 13, 2007, 3:34 pm
Please log in for more thread options

> Hi,
>
> 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.
<snip>
>
> Note that I am effectively connecting to an application rather than a
> true shell.
>

For information I have a solution. Tried Net::SSH::Expect and hit same
issue but this module has a method to change the command terminator and
comments that some systems want to see a \r\n rather than the normal \n on
Unix boxen. Tried this and it works. Flipping windows.

PTL

Similar ThreadsPosted
VC++ Application Connecting PostgreSQL on Linux February 17, 2006, 2:11 am
Using Net::Telnet to connect to Perl server January 22, 2005, 12:57 am
Finding out the time on an FTP server using perl August 30, 2005, 5:27 am
MS SQL server and SQL DATETIME manipulation in perl April 29, 2005, 2:23 am
Net:SSH::Perl oddity when logging in to SSH V2 Server January 16, 2006, 7:03 am
Net::SSH::Perl to connect to a remote server via a web page August 30, 2004, 10:02 am
Microsoft SQL Server 2000 perl module November 11, 2004, 2:12 am
Announce: Win32::SqlServer - access SQL Server from Perl November 27, 2005, 5:03 pm
Net::Server -> tftpd ? May 28, 2006, 6:21 am
TACACS+ with Cisco ACS server 3.2 August 6, 2004, 10:26 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap