sftp

Posted by cdlvj on 2007-04-13 10:53
Forums: PPM | OS: Windows XP Pro

Anyone get sftp to work.

It does a connection, and login.

Then just hangs.

kevinw
ActiveState Staff
Fri, 2007-04-13 15:33

Where did you get the modules you're using? Try the ones at:

http://www.soulcage.net/

Cheers,

kjw

cdlvj | Mon, 2007-04-16 12:58

use strict;

my $host;
my %fargs;
use Net::SFTP;
$host="ftp.server.com";
%fargs = ( user => "usercode", password => 'password', debug => '1', protocol => '2' );
my $sftp = Net::SFTP->new($host, %fargs);

exit;

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

Just loops.

michael.mcgill_... | Mon, 2009-03-16 10:55

I am experiencing the same problem as described in the "sftp" post.

I have worked through the HOME/getpwuid issue
I have worked through the SSH blocking problem in Net::SSH
I can get Net::SSH::Perl to execute a command on the remote server using both SSH1 and SSH2
I can get files using puTTY and plink works fine as well.
I have read numerous posts regarding some alleged package at soulcage.net that fixes everything, but that is not available at all.

When I try to use Net::SFTP it hangs after:

MyClient: Next method to try is publickey.
MyClient: Next method to try is password.
MyClient: Trying password authentication.
MyClient: Login completed, opening dummy shell channel.
MyClient: channel 0: new [client-session]
MyClient: Requesting channel_open for channel 0.
MyClient: channel 0: open confirm rwindow 0 rmax 32768
MyClient: channel 1: new [client-session]
MyClient: Requesting channel_open for channel 1.
MyClient: Sending subsystem: sftp
MyClient: Requesting service subsystem on channel 1.
MyClient: channel 1: open confirm rwindow 0 rmax 32768
MyClient: sftp: Sending SSH2_FXP_INIT

I think I could get Net::SFTP::Foreign to work but would prefer native perl to having to install an additional tool.

Thanks in advance for your help,
Michael