in reply to SFTP Issue
If you can connect, it is likely you get permission denied because the file you seek is not in the directory that you think you are in. Try the fullpathname to the file.#!/usr/bin/perl -w use strict; use Net::SFTP; # Net::SFTP does no error reporting my $sftp = undef; eval{ $sftp = Net::SFTP->new("hostnumber", user=>"me", password=>"mypass", ); }; if ($@) { print "Sftp connection failed:\n $@\n"; } if (! $sftp) { print "I can't connect!\n"; }else{ print "SUCCESS!\n"; }
If you can't connect, try Net::SSH2. See A little demo for Net::SSH2 for how to sftp thru it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: SFTP Issue
by prasanna14 (Initiate) on Jul 15, 2008 at 18:05 UTC |