in reply to Re^8: transfer a file via SFTP
in thread transfer a file via SFTP
You are using the same path on both systems. It might help you isolate the problem if you changed the path for one end at a time.
# cat test_sftp.cgi #!/usr/bin/perl -w use strict; use warnings; use Net::SFTP; my $from = 'TEST.txt'; my $to = '/sftp/tmp/TEST.txt'; my $server = 'X.X.X.X'; my $user = 'user'; my $sftp; my %args = ( ssh_args => { user => 'user', identity_files => [ '/root/.ssh/id_r +sa' ], debug => 1 } ); $sftp = Net::SFTP->new($server, %args) or die "could not open connection to $server\n"; $sftp->put($from, $to) or die "could not upload $file\n"; exit;
Are you running a system with Security Enhanced (SE) Linux (e.g. RedHat)? If so, there may be restrictions on your /sftp directory and/or ssh processes preventing access. If SELinux is preventing access it will probably be logging the faults. Check /var/log/messages (probably).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: transfer a file via SFTP
by cc (Beadle) on Jul 30, 2009 at 11:52 UTC | |
by ig (Vicar) on Jul 30, 2009 at 18:40 UTC | |
by cc (Beadle) on Jul 30, 2009 at 21:27 UTC | |
by ig (Vicar) on Jul 31, 2009 at 21:32 UTC | |
by cc (Beadle) on Jul 31, 2009 at 23:51 UTC | |
|