I am trying to use Net::SSH::W32Perl; I wrote the following test script

use strict; my $host = 'myhost'; my $user = 'user'; my $pass = 'password'; my $cmd = 'ls'; use Net::SSH::W32Perl; my ($ssh, $out, $err, $exit); my %args; $args{debug} = 1; $args{protocol} = 2; $ssh = new Net::SSH::W32Perl($host, %args); $ssh->login($user, $pass); ($out, $err, $exit) = $ssh->cmd("ls"); print "OUT: [$out]\n"; print "ERR: [$err]\n"; print "EXIT: [$exit]\n";

the screen gives the following output then hangs
TODDYCE: Reading configuration data /.ssh/config
TODDYCE: Reading configuration data /etc/ssh_config
TODDYCE: Connecting to myhost, port 22.
TODDYCE: Socket created, turning on blocking...
TODDYCE: Remote protocol version 1.99, remote software version
OpenSSH_3.5p1 FreeBSD-20030201
TODDYCE: Net::SSH::Perl Version 1.25, protocol version 2.0.
TODDYCE: No compat match: OpenSSH_3.5p1 FreeBSD-20030201.
TODDYCE: Connection established.
TODDYCE: Sent key-exchange init (KEXINIT), wait response.
TODDYCE: Algorithms, c->s: 3des-cbc hmac-sha1 none
TODDYCE: Algorithms, s->c: 3des-cbc hmac-sha1 none
TODDYCE: Entering Diffie-Hellman Group 1 key exchange.
TODDYCE: Sent DH public key, waiting for reply.
TODDYCE: Received host key, type 'ssh-dss'.
TODDYCE: Host 'newred.gradwell.net' is known and matches the host key.
TODDYCE: Computing shared secret key.
TODDYCE: Verifying server signature.
TODDYCE: Waiting for NEWKEYS message.
TODDYCE: Enabling incoming encryption/MAC/compression.
TODDYCE: Send NEWKEYS, enable outgoing encryption/MAC/compression.
TODDYCE: Sending request for user-authentication service.
TODDYCE: Service accepted: ssh-userauth.
TODDYCE: Trying empty user-authentication request.
TODDYCE: Authentication methods that can continue: publickey,password,keyboard-interactive.
TODDYCE: Next method to try is publickey.
TODDYCE: Next method to try is password.
TODDYCE: Trying password authentication.
TODDYCE: Login completed, opening dummy shell channel.
TODDYCE: channel 0: new client-session
TODDYCE: Requesting channel_open for channel 0.
TODDYCE: channel 0: open confirm rwindow 0 rmax 32768
TODDYCE: Got channel open confirmation, requesting shell.
TODDYCE: Requesting service shell on channel 0.
TODDYCE: channel 1: new client-session
TODDYCE: Requesting channel_open for channel 1.
TODDYCE: Entering interactive session.
TODDYCE: Sending command: ls
TODDYCE: Requesting service exec on channel 1.
TODDYCE: channel 1: send eof
TODDYCE: channel 1: open confirm rwindow 131070 rmax 32768
TODDYCE: input_channel_request: rtype exit-status reply 0
TODDYCE: channel 1: rcvd eof
TODDYCE: channel 1: output open -> drain
TODDYCE: channel 1: rcvd close
Has anyone got any idea how I can make this?
if i use $args{protocol} = 1; then it will work, but i want to use ssh2. thanks anyway!!


In reply to Help...Issue with Net::SSH::Perl Module by toddyce

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.