S
seth
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.
thanks.
-Seth
Here is the sample code that I'm running:
------------------------------------------------------
#!/usr/bin/perl
use strict;
use Net::SSH::W32Perl;
use Net::SSH:erl;
my $file = ".\\id_rsa";
my $user="mightybob";
my $host="server.company.com";
my $ssh = Net::SSH::W32Perl->new($host,
debug => 1,
protocol=>'2',
interactive=>0,
port=>'22',
identity_files=>["$file"],
use_pty=>1);
$ssh->login($user);
my ($stdout, $stderr, $exit) = $ssh->cmd('ls -l > foo.txt');
print "STDOUT: $stderr \t $exit\n";
Here is the debug output:
------------------------------------------------------
H:\config\forseth_3>perl ssh_rsa.pl
rcctas6w: Reading configuration data /.ssh/config
rcctas6w: Reading configuration data /etc/ssh_config
rcctas6w: Connecting to server.company.com, 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
OpenSSH_3.4p1
rcctas6w: Net::SSH:erl 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 'server.company.com' 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:
publickey,password,keyboard-interactive.
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
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.
thanks.
-Seth
Here is the sample code that I'm running:
------------------------------------------------------
#!/usr/bin/perl
use strict;
use Net::SSH::W32Perl;
use Net::SSH:erl;
my $file = ".\\id_rsa";
my $user="mightybob";
my $host="server.company.com";
my $ssh = Net::SSH::W32Perl->new($host,
debug => 1,
protocol=>'2',
interactive=>0,
port=>'22',
identity_files=>["$file"],
use_pty=>1);
$ssh->login($user);
my ($stdout, $stderr, $exit) = $ssh->cmd('ls -l > foo.txt');
print "STDOUT: $stderr \t $exit\n";
Here is the debug output:
------------------------------------------------------
H:\config\forseth_3>perl ssh_rsa.pl
rcctas6w: Reading configuration data /.ssh/config
rcctas6w: Reading configuration data /etc/ssh_config
rcctas6w: Connecting to server.company.com, 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
OpenSSH_3.4p1
rcctas6w: Net::SSH:erl 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 'server.company.com' 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:
publickey,password,keyboard-interactive.
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