Net::SSH::W32Perl - hanging



Hi all:

I have the following environment:

Citrix session (windows 2000 I believe)
ActiveState perl 5.8.7
Remote machine (either AIX or Linux).
*the debug output included is for connection to the AIX box.

What I'm trying to do:
using Net::SSH::W32Perl to make a ssh connection (passwordless) and
execute a command like this: ls -l >> foo.txt

My problem:
The SSH session hangs.
This script works if it is not run in a citrix session. In other
words, it works fine in my
development environment which does not require me to use citrix.

The debug output shows that I connect, and the requested action is
carried out. It is closing the session, that doesn't work (my guess).

I think the problem *could* be citrix, but I'm just not sure.
I'd appreciate some feedback, as to what else I can try.
I'm wondering if anyone can give specific feedback as to what to try,
but looking at my debug output for the SSH
connection the script invokes.



Here is the sample code that I'm running:


use strict;

use Net::SSH::W32Perl;
use Net::SSH::perl;

my $file = ".\\id_rsa";

my $user="mightybob";
my $host="";

my $ssh = Net::SSH::W32Perl->new($host,
debug => 1,


my ($stdout, $stderr, $exit) = $ssh->cmd('ls -l > foo.txt');

print "STDOUT: $stderr \t $exit\n";

Here is the debug output:

rcctas6w: Reading configuration data /.ssh/config
rcctas6w: Reading configuration data /etc/ssh_config
rcctas6w: Connecting to, port 22.
rcctas6w: Socket created, turning on blocking...
rcctas6w: Remote version string: SSH-1.99-OpenSSH_3.4p1

rcctas6w: Remote protocol version 1.99, remote software version
rcctas6w: Net::SSH::perl Version 1.30, protocol version 2.0.
rcctas6w: No compat match: OpenSSH_3.4p1.
rcctas6w: Connection established.
rcctas6w: Sent key-exchange init (KEXINIT), wait response.
rcctas6w: Algorithms, c->s: 3des-cbc hmac-sha1 none
rcctas6w: Algorithms, s->c: 3des-cbc hmac-sha1 none
rcctas6w: Entering Diffie-Hellman Group 1 key exchange.
rcctas6w: Sent DH public key, waiting for reply.
rcctas6w: Received host key, type 'ssh-dss'.
rcctas6w: Host '' is known and matches the host key.
rcctas6w: Computing shared secret key.
rcctas6w: Verifying server signature.
rcctas6w: Waiting for NEWKEYS message.
rcctas6w: Enabling incoming encryption/MAC/compression.
rcctas6w: Send NEWKEYS, enable outgoing encryption/MAC/compression.
rcctas6w: Sending request for user-authentication service.
rcctas6w: Service accepted: ssh-userauth.
rcctas6w: Trying empty user-authentication request.
rcctas6w: Authentication methods that can continue:
rcctas6w: Next method to try is publickey.
rcctas6w: Trying pubkey authentication with key file '.\id_rsa'
rcctas6w: Login completed, opening dummy shell channel.
rcctas6w: channel 0: new [client-session]
rcctas6w: Requesting channel_open for channel 0.
rcctas6w: channel 0: open confirm rwindow 0 rmax 32768
rcctas6w: Got channel open confirmation, requesting shell.
rcctas6w: Requesting service shell on channel 0.
rcctas6w: channel 1: new [client-session]
rcctas6w: Requesting channel_open for channel 1.
rcctas6w: Entering interactive session.
rcctas6w: Sending command: ls -l > ssh.3
rcctas6w: Requesting service exec on channel 1.
rcctas6w: channel 1: open confirm rwindow 0 rmax 32768


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question