Click here to get back home

Help with Net::SFTP when sftp on unix works.

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Help with Net::SFTP when sftp on unix works. Ree-Yees 09-21-2004
Posted by Ree-Yees on September 21, 2004, 11:14 am
Please log in for more thread options
Running on AIX, the unix sftp will connect to my site just fine, but the
Net::SFTP perl modules hangs at one point.

Here are the logs for the unix sftp:
Connecting to #.#.#.#...
OpenSSH_3.7p1, SSH protocols 1.5/2.0, OpenSSL 0.9.7b 10 Apr 2003
debug1: Reading configuration data /usr/local/etc/ssh_config
debug1: Connecting to #.#.#.#[#.#.#.#] port 22.
debug1: Connection established.
debug1: identity file /u/home/#####/.ssh/id_rsa type -1
debug1: identity file /u/home/#####/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version 1.29 sshlib:
MOVEit DMZ SSH 3.1.0.0
debug1: no match: 1.29 sshlib: MOVEit DMZ SSH 3.1.0.0
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.7p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host '#.#.#.#' is known and matches the DSA host key.
debug1: Found key in /u/home/#####/.ssh/known_hosts2:1
debug1: ssh_dss_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /u/home/###/.ssh/id_rsa
debug1: Trying private key: /u/home/####/.ssh/id_dsa
debug1: Next authentication method: password
#####@#######'s password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending subsystem: sftp
sftp> ls



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

program
use Net::SFTP;

print "Startingn";

my %args = (user => "###", password => "####", debug => "1", ssh_args =>
[port => 22]
);
my $Session = Net::SFTP->new("#.#.#.#", %args);

print $Session->ls();

Thanks!





Posted by chris-usenet on September 21, 2004, 9:39 pm
Please log in for more thread options
> Running on AIX, the unix sftp will connect to my site just fine, but the
> Net::SFTP perl modules hangs at one point.

Yeah. I've seen that too, when talking to certain types of server. It's
consistent (ie works or hangs) for a given server, though. I thought I'd
found the problem and wrote to the author but wasn't given the courtesy
of either a reply or a bounce. Oh, and my empirical "fix" moved the
goalposts but it still hung... sometimes.

In the end I wrote a Net::SFTP::Wrapper that emulated enough of Net::SFTP
for my requirements by using Expect on "sftp" itself. Ugly, but you're
welcome to it if it's any use to you.

Chris
--
I don't need "usenet" when emailing to roaima.co.uk


Similar ThreadsPosted
Net::SFTP installation January 12, 2005, 11:35 pm
Net::SFTP on Windows March 21, 2005, 9:55 pm
Net::SFTP::Attributes October 23, 2006, 11:56 am
problem using Net::SFTP with pubkey September 1, 2005, 4:29 am
Net::SFTP port problem July 26, 2004, 2:18 pm
Net::SFTP transfer speed December 14, 2004, 8:14 am
Aargh. SFTP problems March 15, 2005, 2:35 pm
net::sftp connection close May 4, 2006, 6:27 am
NET::SFTP - how to close connection September 28, 2006, 7:22 am
password in SFTP::Foreign August 23, 2007, 11:48 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap