Hi Justin, Sort of gave up for the time being, redirecting output was no good for me. I to have found a lot of posting on google describing the same problem but i've yet to find an answer. Best of luck Adrian

Allegakoen, Justin Devanandan writes:
Adrian, Did you manage to get the ls -l output in @out?
I've done a lot of googling for Net::SSH::W32Perl, and after all of what
I've read redirection seems like the only way.
Initially I thought redirection would be okay if I could SFTP the
redirected output over to my Windoze machine, but Net::SFTP seems to
hang as well even after updating the module to use Net::SSH::W32Perl. I don't suppose you gave up with the whole thing and used CGI? Any feedback would be useful. Thanks
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
$Bill Luebkert
Sent: Thursday, December 15, 2005 9:13 PM
To: Adrian Neville
Cc: [email protected]
Subject: Re: Net::SSH::W32Perl Adrian Neville wrote:
Hi,
Has anyone got Net::SSH::W32Perl to work on Windows XP, I have
ActiveState
Perl 5.8 installed, and have downloaded the Net::SSH::W32Perl ppm's
from
soulcage.
The following example hangs if the command sent to the remote server
returns
any data, if the output on the ls is redirected it works ok
I have seen a lot of postings on the web for the same problem but
haven't
found an answer. sample code
use Net::SSH::W32Perl

Missing ;
$machine="localhost";
$ssh=Net::SSH::W32Perl->new($machine, port=>22, debug=>1);
$ssh->login("user", "password");
@out=$ssh->cmd("ls -l c:\/ ", "\n");
print @out;

Works for me XP Pro to a Linux server - version 0.05 of module.
I used "ls -lF\n" for command since there is no C:/.
debug trace before the hang
C:\Documents and Settings\Adrian\My Documents>perl ssh.pl
ADRIANPC: Reading configuration data /.ssh/config
ADRIANPC: Reading configuration data /etc/ssh_config
ADRIANPC: Connecting to localhost, port 22.
ADRIANPC: Socket created, turning on blocking...
ADRIANPC: Remote protocol version 2.0, remote software version
OpenSSH_4.2
ADRIANPC: Net::SSH::Perl Version 1.29, protocol version 2.0.
ADRIANPC: No compat match: OpenSSH_4.2.
ADRIANPC: Connection established.
ADRIANPC: Sent key-exchange init (KEXINIT), wait response.
ADRIANPC: Algorithms, c->s: 3des-cbc hmac-sha1 none
ADRIANPC: Algorithms, s->c: 3des-cbc hmac-sha1 none
ADRIANPC: Entering Diffie-Hellman Group 1 key exchange.
ADRIANPC: Sent DH public key, waiting for reply.
ADRIANPC: Received host key, type 'ssh-dss'.
ADRIANPC: Host 'localhost' is known and matches the host key.
ADRIANPC: Computing shared secret key.
ADRIANPC: Verifying server signature.
ADRIANPC: Waiting for NEWKEYS message.
ADRIANPC: Enabling incoming encryption/MAC/compression.
ADRIANPC: Send NEWKEYS, enable outgoing encryption/MAC/compression.
ADRIANPC: Sending request for user-authentication service.
ADRIANPC: Service accepted: ssh-userauth.
ADRIANPC: Trying empty user-authentication request.
ADRIANPC: Authentication methods that can continue: publickey,password,keyboard-interactive.
ADRIANPC: Next method to try is publickey.
ADRIANPC: Next method to try is password.
ADRIANPC: Trying password authentication.
ADRIANPC: Login completed, opening dummy shell channel.
ADRIANPC: channel 0: new [client-session]
ADRIANPC: Requesting channel_open for channel 0.
ADRIANPC: channel 0: open confirm rwindow 0 rmax 32768
ADRIANPC: Got channel open confirmation, requesting shell.
ADRIANPC: Requesting service shell on channel 0.
ADRIANPC: channel 1: new [client-session]
ADRIANPC: Requesting channel_open for channel 1.
ADRIANPC: Entering interactive session.
ADRIANPC: Sending command: ls -l c:/
ADRIANPC: Requesting service exec on channel 1.
ADRIANPC: channel 1: send eof
ADRIANPC: channel 1: open confirm rwindow 131071 rmax 32768
ADRIANPC: input_channel_request: rtype exit-status reply 0 if i replace the command with @out=$ssh->cmd("ls -l c:\/ >/tmp/out.txt", "\n"); it works ok, but i really need the output returned to the client.

--
  ,-/-  __      _  _         $Bill Luebkert
Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic
http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to