Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Net-SSH-W32Perl strange behaviour.

Reply
Thread Tools

Net-SSH-W32Perl strange behaviour.

 
 
fhornain@gmail.com
Guest
Posts: n/a
 
      03-06-2007
Hi,

Well, I am currently stuck with a stange Perl behaviour.
Indeed, I am trying to create a Perl SSH client script on Windows -
but you have already noticed that in the title of this message -
which could be connected on a Vandyke Vshell - SSH deamon for Ms
Windows -.

This is the content of my script I have mostly retreived from the CPAN
web site - http://search.cpan.org/~scotts/Net-S...SSH/W32Perl.pm
- :

use strict;
use warnings;
use Net::SSH::W32Perl;

&windows();

sub windows ()
{
my ($user,$pass,$host,$cmd)
=("MY_USER","MY_PASSWORD","MY_MACHINE_ADDRESS","MY _NICE _COMMAND");
my $ssh = Net::SSH::W32Perl->new($host,protocole =>2, debug
=> 0);
$ssh->login($user, $pass);
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
print "Standard out: $stdout\nStandard Error: $stderr\nExit
code: $exit\n";
}

The problem is firstly it returns the following messages :

IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110

Ok, I agree despite this message it return the correct result.
Well, sometime ! - I am going to explain below -

In fact, it returns the correct result only the first or the second
time you launch it.
Otherwise, it freezes.
Behaviour that I do not really want.

So, this is the ouput of this program during its execution but in
debug mode :

machinename: Reading configuration data /.ssh/config
machinename: Reading configuration data /etc/ssh_config
machinename: Connecting to localhost, port 22.
machinename: Socket created, turning on blocking...
machinename: Remote protocol version 2.0, remote software version
VShell_2_6_4_4
8 VShell
machinename: Net::SSH:erl Version 1.23_01, protocol version 2.0.
machinename: No compat match: VShell_2_6_4_448 VShell
machinename: Connection established.
machinename: Sent key-exchange init (KEXINIT), wait response.
machinename: Algorithms, c->s: 3des-cbc hmac-sha1 none
machinename: Algorithms, s->c: 3des-cbc hmac-sha1 none
machinename: Entering Diffie-Hellman Group 1 key exchange.
machinename: Sent DH public key, waiting for reply.
machinename: Received host key, type 'ssh-dss'.
machinename: Host 'localhost' is known and matches the host key.
machinename: Computing shared secret key.
machinename: Verifying server signature.
machinename: Waiting for NEWKEYS message.
machinename: Enabling incoming encryption/MAC/compression.
machinename: Send NEWKEYS, enable outgoing encryption/MAC/
compression.
machinename: Sending request for user-authentication service.
machinename: Service accepted: ssh-userauth.
machinename: Trying empty user-authentication request.
machinename: Authentication methods that can continue: password.
machinename: Next method to try is password.
machinename: Trying password authentication.
machinename: Login completed, opening dummy shell channel.
machinename: channel 0: new [client-session]
machinename: Requesting channel_open for channel 0.
machinename: channel 0: open confirm rwindow 32768 rmax 16384
machinename: Got channel open confirmation, requesting shell.
machinename: Requesting service shell on channel 0.
machinename: channel 1: new [client-session]
machinename: Requesting channel_open for channel 1.
machinename: Entering interactive session.
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
machinename: Sending command: cluster localhost group /status
machinename: Requesting service exec on channel 1.
machinename: channel 1: open confirm rwindow 32768 rmax 16384
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110

Now, cherry on the cake!
I have tried to do the same test with an OpenSSH deamon - for the
server side, I mean -.
Ok, I always have the error message :

IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
BlaBla...

But in contrary of Vshell the Perl SSH client script does not seem
stuck.
it runs every time.

This what I have noticed :
With Vandyke VShell, the script uses

machinename: channel 0: open confirm rwindow 32768 rmax 16384

However with OpenSSH, the script uses :

machinename: channel 1: open confirm rwindow 0 rmax 32768


So I have got five questions :


- How can I make my little Perl SSH Client script work ?
- How can I fix error message during the Perl script execution ?
- Why there is difference between Vshell and OpenSsh with the SSH
packet window size ?
- Is there a way to specify the SSH packet window size in Perl?
- Could you give me a hand please ?

Thanks a lot in advance.
BR
Fred

 
Reply With Quote
 
 
 
 
fhornain@gmail.com
Guest
Posts: n/a
 
      03-06-2007
Hi again,

I think that I forgot two important information.

Well, I use active perl and Net-SSH-W32Perl modules comming from
http://www.soulcage.net/PPDS.58/.

And yes, I have still got one little questions.

- Knowing that I can not use public key, do you know another mean
in perl to access SSH Server on Windows platform ?

Thanks in advance for your help.
BR
Fred



 
Reply With Quote
 
 
 
 
fhornain@gmail.com
Guest
Posts: n/a
 
      03-06-2007
> s/protocole/protocol/
Done ! But the problem is still there.

>Please do read and follow the posting guidelines for this group.

I already done that.
What is wrong with my post ?

Thanks a lot for your help.
BR
Fred

 
Reply With Quote
 
chenws3000@gmail.com
Guest
Posts: n/a
 
      03-09-2007
On Mar 6, 3:54 am, (E-Mail Removed) wrote:
> Hi,
>
> Well, I am currently stuck with a stange Perl behaviour.
> Indeed, I am trying to create a Perl SSH client script on Windows -
> but you have already noticed that in the title of this message -
> which could be connected on a Vandyke Vshell - SSH deamon for Ms
> Windows -.
>
> This is the content of my script I have mostly retreived from the CPAN
> web site -http://search.cpan.org/~scotts/Net-SSH-W32Perl-0.05/lib/Net/SSH/W32Pe...
> - :
>
> use strict;
> use warnings;
> use Net::SSH::W32Perl;
>
> &windows();
>
> sub windows ()
> {
> my ($user,$pass,$host,$cmd)
> =("MY_USER","MY_PASSWORD","MY_MACHINE_ADDRESS","MY _NICE _COMMAND");
> my $ssh = Net::SSH::W32Perl->new($host,protocole =>2, debug
> => 0);
> $ssh->login($user, $pass);
> my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
> print "Standard out: $stdout\nStandard Error: $stderr\nExit
> code: $exit\n";
> }
>
> The problem is firstly it returns the following messages :
>
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
>
> Ok, I agree despite this message it return the correct result.
> Well, sometime ! - I am going to explain below -
>
> In fact, it returns the correct result only the first or the second
> time you launch it.
> Otherwise, it freezes.
> Behaviour that I do not really want.
>
> So, this is the ouput of this program during its execution but in
> debug mode :
>
> machinename: Reading configuration data /.ssh/config
> machinename: Reading configuration data /etc/ssh_config
> machinename: Connecting to localhost, port 22.
> machinename: Socket created, turning on blocking...
> machinename: Remote protocol version 2.0, remote software version
> VShell_2_6_4_4
> 8 VShell
> machinename: Net::SSH:erl Version 1.23_01, protocol version 2.0.
> machinename: No compat match: VShell_2_6_4_448 VShell
> machinename: Connection established.
> machinename: Sent key-exchange init (KEXINIT), wait response.
> machinename: Algorithms, c->s: 3des-cbc hmac-sha1 none
> machinename: Algorithms, s->c: 3des-cbc hmac-sha1 none
> machinename: Entering Diffie-Hellman Group 1 key exchange.
> machinename: Sent DH public key, waiting for reply.
> machinename: Received host key, type 'ssh-dss'.
> machinename: Host 'localhost' is known and matches the host key.
> machinename: Computing shared secret key.
> machinename: Verifying server signature.
> machinename: Waiting for NEWKEYS message.
> machinename: Enabling incoming encryption/MAC/compression.
> machinename: Send NEWKEYS, enable outgoing encryption/MAC/
> compression.
> machinename: Sending request for user-authentication service.
> machinename: Service accepted: ssh-userauth.
> machinename: Trying empty user-authentication request.
> machinename: Authentication methods that can continue: password.
> machinename: Next method to try is password.
> machinename: Trying password authentication.
> machinename: Login completed, opening dummy shell channel.
> machinename: channel 0: new [client-session]
> machinename: Requesting channel_open for channel 0.
> machinename: channel 0: open confirm rwindow 32768 rmax 16384
> machinename: Got channel open confirmation, requesting shell.
> machinename: Requesting service shell on channel 0.
> machinename: channel 1: new [client-session]
> machinename: Requesting channel_open for channel 1.
> machinename: Entering interactive session.
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> machinename: Sending command: cluster localhost group /status
> machinename: Requesting service exec on channel 1.
> machinename: channel 1: open confirm rwindow 32768 rmax 16384
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
>
> Now, cherry on the cake!
> I have tried to do the same test with an OpenSSH deamon - for the
> server side, I mean -.
> Ok, I always have the error message :
>
> IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
> IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
> BlaBla...
>
> But in contrary of Vshell the Perl SSH client script does not seem
> stuck.
> it runs every time.
>
> This what I have noticed :
> With Vandyke VShell, the script uses
>
> machinename: channel 0: open confirm rwindow 32768 rmax 16384
>
> However with OpenSSH, the script uses :
>
> machinename: channel 1: open confirm rwindow 0 rmax 32768
>
> So I have got five questions :
>
> - How can I make my little Perl SSH Client script work ?
> - How can I fix error message during the Perl script execution ?
> - Why there is difference between Vshell and OpenSsh with the SSH
> packet window size ?
> - Is there a way to specify the SSH packet window size in Perl?
> - Could you give me a hand please ?
>
> Thanks a lot in advance.
> BR
> Fred


RE: How can I fix error message during the Perl script execution ?

I meet the same problem those days, and I try to find the solution
from internet.
However, there are few info about this issue. So I decide to dug it by
myself. When I debug the script into Carp.pm (version 1.04). I find
the reason.

in line 271 just replace

sub carp { warn shortmess @_ }

to

sub carp { }

all strange messages are gone.

Vincent Chen


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AVG Email Scanner activating at strange times with strange IP addresses dennispublic@hotmail.com Computer Support 1 08-26-2006 04:27 AM
Strange Wireless Network problem Sarah Kingswell Wireless Networking 1 02-15-2005 06:24 PM
strange problem John Wireless Networking 4 02-14-2005 05:40 PM
Strange taskbar behaviour (notification area) Falcon Wireless Networking 0 08-17-2004 09:03 AM
Question About Strange 'C' Code Syntax ( Well strange to me anyway ) Harvey Twyman C Programming 8 10-25-2003 05:54 AM



Advertisments