Net::SFTP module in Perl
Page 1 of 1
Ace128




Posts: 337

PostPosted: Mon, 28th Feb 2005 02:36    Post subject: Net::SFTP module in Perl
Hey,

After alot of trial and error, I thought I post and see if someone got any further than me...

Anyone here that have installed Net::SFTP module in perl and actually made it work? I get as far as this:

>perl SFTPTest.pl
slackware: Reading configuration data ~/.ssh/config
slackware: Reading configuration data /etc/ssh_config
slackware: Connecting to localhost, port 21.
slackware: Socket created, turning on blocking...
slackware: Remote protocol version ., remote software version
slackware: Net::SSH::Perl Version 1.23_01, protocol version 2.0.
slackware: No compat match: .
slackware: Connection established.
slackware: Sent key-exchange init (KEXINIT), wait response.
Bad packet length 892350496 at /usr/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/Packet.pm line 175

And I have to "hardcode" stuff like choosing SSH2! But, it would be nice if someone had some fix for this, or even a step-by-step guide how to do it all from scratch. Since Perl is so powerfull as it is, I prefer scripting in that instead of bash and tcl. Smile If I just could make this work, wow! Talk about opportuneties Very Happy

Also, I'm not sure how to create the damn keys to use. Anyone here that can help me with that too? I _think_ the problem here is/are the key(s)!

Script looks like this:
Code:

#!/usr/bin/perl -w

use Net::SFTP;
use strict;

my $host = "localhost";
my $user = "ace";
my $pass = "temp";
my $port = 21;

my %args = (ssh_args => []);
$args{user} = $user;
$args{password} = $pass;
$args{debug} = 1;
$args{protocol} = '2,1';

push @{ $args{ssh_args} }, port => $port;
my $sftp = Net::SFTP->new($host, %args);



Thanks,
Ace
Back to top
bulio
VIP Member



Posts: 126
Location: Canada
PostPosted: Mon, 28th Feb 2005 04:35    Post subject:
Topic Moved to the right section.
Back to top
Ace128




Posts: 337

PostPosted: Tue, 1st Mar 2005 21:46    Post subject:
Seems like I confused SFTP with FTPS!
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group