MurDog has asked for the wisdom of the Perl Monks concerning the following question:

Hey Monks,
Just installed F-Secures SSH service on a Windows 2000 server.
I am trying to run a simple "dir" and retrieve the output.

Here's what I have so far.
The Code:
#!d:/perl -w use strict; use Net::SSH::W32Perl; my ($ipaddr,$userid,$passwd) = ("<ipaddress>","<userid>","<password>") +; my $cmd = "dir"; my $ssh = Net::SSH::W32Perl->new("$ipaddr", protocol => '2,1',debug => + 1); my ($out, $err, $exit,$msg); $ssh->login("$userid","$passwd"); ($out, $err, $exit) = $ssh->cmd("$cmd"); print $out. $err. $exit."\n"; close $ssh;
The output with debugging on:
computername: Reading configuration data /.ssh/config computername: Reading configuration data /etc/ssh_config computername: Connecting to computername, port 22. computername: Socket created, turning on blocking... computername: Remote protocol version 2.0, remote software version 3.2 +.0 F-Secure SSH Windows NT Server computername: Net::SSH::Perl Version 1.23, protocol version 2.0. computername: No compat match: 3.2.0 F-Secure SSH Windows NT Server computername: Connection established. computername: Sent key-exchange init (KEXINIT), wait response. computername: Algorithms, c->s: 3des-cbc hmac-sha1 none computername: Algorithms, s->c: 3des-cbc hmac-sha1 none computername: Entering Diffie-Hellman Group 1 key exchange. computername: Sent DH public key, waiting for reply. computername: Received host key, type 'ssh-dss'. computername: Host 'computername' is known and matches the host key. computername: Computing shared secret key. computername: Verifying server signature. computername: Waiting for NEWKEYS message. computername: Enabling incoming encryption/MAC/compression. computername: Send NEWKEYS, enable outgoing encryption/MAC/compression +. computername: Sending request for user-authentication service. computername: Service accepted: ssh-userauth. computername: Trying empty user-authentication request. computername: Authentication methods that can continue: publickey,pass +word. computername: Next method to try is publickey. computername: Next method to try is password. computername: Trying password authentication. computername: Login completed, opening dummy shell channel. computername: channel 0: new [client-session] computername: Requesting channel_open for channel 0. computername: channel 0: open confirm rwindow 100000 rmax 16384 computername: Got channel open confirmation, requesting shell. computername: Requesting service shell on channel 0. computername: channel 1: new [client-session] computername: Requesting channel_open for channel 1. computername: Entering interactive session. computername: Sending command: echo dir computername: Requesting service exec on channel 1. computername: channel 1: open confirm rwindow 100000 rmax 16384
After the channel 1 is open the script hangs. I have run
this against the Windows install and Linux server with
OPENSSH 3.0 install. Same problem. Sorry, this looks
like an easy one. Read all the docs and online info. No Luck so far...Go easy on the initiate :)

A nudge in the right direction is appreciated

MurDog - Chien Mur to my French brothers.