#!/usr/bin/perl
use Net::SSH::W32Perl;
my $host = 'x.x.x.x';
my $ssh = new Net::SSH::W32Perl($host);
$ssh->login('XXX', XXX);
my ($out, $err, $exit) = $ssh->cmd('show vlan brief');
print $out;
print $err;
print $exit;
####
#!/usr/bin/perl
use Net::SSH::W32Perl;
$ENV{HOME} = "C:\\";
my $host = '10.167.14.126';
my $ssh = new Net::SSH::W32Perl($host,debug=>1);
$ssh->login('xxx', 'xxx');
my $out = $ssh->cmd('ll');
print $out;
####
Mike: Reading configuration data C:\/.ssh/config
Mike: Reading configuration data /etc/ssh_config
Mike: Connecting to 10.167.14.126, port 22.
Mike: Socket created, turning on blocking...
Mike: Remote protocol version 2.0, remote software version OpenSSH_4.3
Mike: Net::SSH::Perl Version 1.34, protocol version 2.0.
Mike: No compat match: OpenSSH_4.3.
Mike: Connection established.
Mike: Sent key-exchange init (KEXINIT), wait response.
Mike: Algorithms, c->s: 3des-cbc hmac-sha1 none
Mike: Algorithms, s->c: 3des-cbc hmac-sha1 none
Mike: Entering Diffie-Hellman Group 1 key exchange.
Mike: Sent DH public key, waiting for reply.
Mike: Received host key, type 'ssh-dss'.
Mike: Host '10.167.14.126' is known and matches the host key.
Mike: Computing shared secret key.
Mike: Verifying server signature.
Mike: Waiting for NEWKEYS message.
Mike: Send NEWKEYS.
Mike: Enabling encryption/MAC/compression.
Mike: Sending request for user-authentication service.
Mike: Service accepted: ssh-userauth.
Mike: Trying empty user-authentication request.
Mike: Authentication methods that can continue: publickey,gssapi-with-mic,password.
Mike: Next method to try is publickey.
Mike: Next method to try is password.
Mike: Trying password authentication.
Mike: Login completed, opening dummy shell channel.
Mike: channel 0: new [client-session]
Mike: Requesting channel_open for channel 0.
Mike: channel 0: open confirm rwindow 0 rmax 32768
Mike: Got channel open confirmation, requesting shell.
Mike: Requesting service shell on channel 0.
Mike: channel 1: new [client-session]
Mike: Requesting channel_open for channel 1.
sxcMike: Entering interactive session.
Mike: Sending command: ll
Mike: Sending command: ll (<==== why twice?)
Mike: Requesting service exec on channel 1.
Mike: channel 1: open confirm rwindow 0 rmax 32768 (<==== hangs here, no return)