Hi all,

I'm doing some testing of the Net::SFTP module to connect from my linux box to a solaris box.
I've written the following test code:

#!/usr/bin/perl use strict; use warnings; use Net::SFTP; # Set up the variables for the FTP. my $hostname = 'myhost'; my $sftp; our %args=( user => "myuser", password => "mypass", debug => 1 ); $sftp = Net::SFTP->new($hostname, %args); # close($sftp->{ssh}->sock()); print $sftp->status;

This does work, but takes 3 - 4 minutes to complete. I have tried sftp from the command line and this works very quickly so I'm not quite sure whats going on.

The debug info from my script is:

[test]$ ./sftp.pl appdev: Reading configuration data /home/doug/.ssh/config appdev: Reading configuration data /etc/ssh_config appdev: Connecting to rmcsap01, port 22. appdev: Remote protocol version 2.0, remote software version Sun_SSH_1 +.0 appdev: Net::SSH::Perl Version 1.28, protocol version 2.0. appdev: No compat match: Sun_SSH_1.0. appdev: Connection established. appdev: Sent key-exchange init (KEXINIT), wait response. appdev: Algorithms, c->s: 3des-cbc hmac-sha1 none **appdev: Algorithms, s->c: 3des-cbc hmac-sha1 none appdev: Entering Diffie-Hellman Group 1 key exchange. appdev: Sent DH public key, waiting for reply. appdev: Received host key, type 'ssh-dss'. appdev: Host 'rmcsap01' is known and matches the host key. **appdev: Computing shared secret key. appdev: Verifying server signature. appdev: Waiting for NEWKEYS message. appdev: Enabling incoming encryption/MAC/compression. appdev: Send NEWKEYS, enable outgoing encryption/MAC/compression. appdev: Sending request for user-authentication service. appdev: Service accepted: ssh-userauth. appdev: Trying empty user-authentication request. appdev: Authentication methods that can continue: publickey,password. appdev: Next method to try is publickey. appdev: Next method to try is password. appdev: Trying password authentication. appdev: Login completed, opening dummy shell channel. appdev: channel 0: new [client-session] appdev: Requesting channel_open for channel 0. appdev: channel 0: open confirm rwindow 0 rmax 16384 appdev: Got channel open confirmation, requesting shell. appdev: Requesting service shell on channel 0. appdev: channel 1: new [client-session] appdev: Requesting channel_open for channel 1. appdev: Sending subsystem: sftp appdev: Requesting service subsystem on channel 1. appdev: channel 1: open confirm rwindow 0 rmax 16384 appdev: sftp: Sending SSH2_FXP_INIT appdev: sftp: Remote version: 2

I've marked the lines that pause for longest with a **.
Anyone got any ideas.

many thanks,
Doug.


In reply to Net::SFTP connection takes long time by DougC

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.