Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Re: Re: SFTP hangs (winxp)

by rkg (Hermit)
on Dec 07, 2003 at 14:12 UTC ( [id://312916]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: SFTP hangs (winxp)
in thread SFTP hangs (winxp)

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$/";

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: SFTP hangs (winxp)
by shenme (Priest) on Dec 10, 2003 at 05:26 UTC
    Just found Net::SSH::W32Perl today, and found the same problem.   Note the thread at NET::SSH::W32PERL - script Hangs when trying to run a command where same complaint is raised - hanging at the same point.   Has anyone gotten Net:SSH::* to work on Win32 in recent times?
    TLSXPA: Login completed, opening dummy shell channel.
    TLSXPA: channel 0: new client-session
    TLSXPA: Requesting channel_open for channel 0.
    TLSXPA: channel 0: open confirm rwindow 0 rmax 32768
    TLSXPA: Got channel open confirmation, requesting shell.
    TLSXPA: Requesting service shell on channel 0.
    TLSXPA: channel 1: new client-session
    TLSXPA: Requesting channel_open for channel 1.
    TLSXPA: Entering interactive session.
    TLSXPA: Sending command: date
    TLSXPA: Requesting service exec on channel 1.
    TLSXPA: channel 1: open confirm rwindow 0 rmax 32768
    
    Hey, just found rebuilt for AS 5.8.x. I'll see what happens if I _can_ uninstall Net::SSH::* and reinstall from his site. (sigh)
Re: Re: Re: Re: Re: SFTP hangs (winxp)
by shenme (Priest) on Dec 10, 2003 at 05:55 UTC
    Hoorah!   Hoorah!
    TLSXPA: Entering interactive session.
    TLSXPA: Sending command: date
    TLSXPA: Requesting service exec on channel 1.
    TLSXPA: channel 1: open confirm rwindow 0 rmax 32768
    TLSXPA: input_channel_request: rtype exit-status reply 0
    TLSXPA: channel 1: rcvd eof
    TLSXPA: channel 1: output open -> drain
    TLSXPA: channel 1: rcvd close
    TLSXPA: channel 1: input open -> closed
    TLSXPA: channel 1: close_read
    TLSXPA: channel 1: obuf empty
    TLSXPA: channel 1: output drain -> closed
    TLSXPA: channel 1: close_write
    TLSXPA: channel 1: send close
    TLSXPA: channel 1: full closed
     exit   '0'
     stdout 'Tue Dec  9 23:28:44 CST 2003'
    
    I added Scott Scecina's repository as advised
    rep add soulcage http://www.soulcage.net/ppds.58/
    then moved the repository higher in the list that PPM3 was looking at, then uninstalled both Net-SSH-W32Perl and Net-SSH-Perl, then re-installed Net-SSH-W32Perl from his repository, and huzzah!

    And after reading his ERRATA.txt comments, where he said he'd modified Net::SFTP to understand to use Net::SSH::W32Perl, I uninstalled Net-SFTP and re-installed it.   I retried the Net::SFTP test program.   After figuring out that I needed to change the ls() call to   my @files = $sftp->ls('.');   I was able to get it working too!

    Now... what did I want it for ... ?   So long ago ... can't ... remember...

      Great node, thanks. Yes, the order of install / uninstall matters. Many many thanks.
        hi, How u do it.ı uninstall and reinstall net::ssh:*.but it's not working.can you help me,pelase what can ı do

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://312916]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-03-28 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found