Hi idsfa,

Just getting around to trying your suggestion after a long delay. Thanks for the advice.

After installing Net::SSH::W32Perl, I tried your test script. It logs in happily, then hangs at the "hostname" command, sort of like my original post. Any ideas, or do you think the problem is on the server side?

rkg

C:\perl\test_snippets>perl net-ssh.pl denmark: Reading configuration data /.ssh/config denmark: Reading configuration data /etc/ssh_config denmark: Connecting to XXXXXXXXXX, port 22. denmark: Socket created, turning on blocking... denmark: Remote protocol version 1.99, remote software version OpenSSH +_3.4p1 denmark: Net::SSH::Perl Version 1.23, protocol version 2.0. denmark: No compat match: OpenSSH_3.4p1. denmark: Connection established. denmark: Sent key-exchange init (KEXINIT), wait response. denmark: Algorithms, c->s: 3des-cbc hmac-sha1 none denmark: Algorithms, s->c: 3des-cbc hmac-sha1 none denmark: Entering Diffie-Hellman Group 1 key exchange. denmark: Sent DH public key, waiting for reply. denmark: Received host key, type 'ssh-dss'. denmark: Host XXXXXXX is known and matches the host key. denmark: Computing shared secret key. denmark: Verifying server signature. denmark: Waiting for NEWKEYS message. denmark: Enabling incoming encryption/MAC/compression. denmark: Send NEWKEYS, enable outgoing encryption/MAC/compression. denmark: Sending request for user-authentication service. denmark: Service accepted: ssh-userauth. denmark: Trying empty user-authentication request. denmark: Authentication methods that can continue: publickey,password, +keyboard-interactive. denmark: Next method to try is publickey. denmark: Next method to try is password. denmark: Trying password authentication. denmark: Login completed, opening dummy shell channel. denmark: channel 0: new [client-session] denmark: Requesting channel_open for channel 0. denmark: channel 0: open confirm rwindow 0 rmax 32768 denmark: Got channel open confirmation, requesting shell. denmark: Requesting service shell on channel 0. denmark: channel 1: new [client-session] denmark: Requesting channel_open for channel 1. denmark: Entering interactive session. denmark: Sending command: hostname denmark: Requesting service exec on channel 1. denmark: channel 1: open confirm rwindow 0 rmax 32768
...and it hangs here.

Here's the code

use Net::SSH::W32Perl; my $ssh = Net::SSH::W32Perl->new("XXXXXX", protocol=>2, debug=>1); $ssh->login("XXXXX", "XXXXXX"); ($out, $err, $exit) = $ssh->cmd("hostname"); print "Out: $out$/Err: $err$/Exit: $exit$/";

In reply to Re: Re: Re: Re: SFTP hangs (winxp) by rkg
in thread SFTP hangs (winxp) by rkg

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.