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
$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;
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.
Thanks
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs