ActiveState Community

Net::SFTP::Foreign

Posted by rekhalathia on 2009-11-05 03:52

For file transferring we were using Native::SFTP. But now we want to switch over to Native::SFTP::Foreign. We are facing the following issues:-
For some servers where we are able to transfer file through Native::SFTP is not working with the new Native::SFTP::Foreign.
We are not able to create directories and also not able to transfer files. It is giving the following error:-
ERROR 1
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f
debug1: Reading configuration data /home/dmd_batch/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Rhosts Authentication disabled, originating port will not be trusted.
ssh: edrops.musicnet.com : Name or service not known
ERROR 2
Couldn't setstat remote file (fsetstat): Permission denied
For above ERROR 2 we researched on net and found that if we pass the third parameter late_set_perm => 1 to put function it should work but it did not helped.
$sftp->put($local, $remote, late_set_perm => 1)
Please let me know if you have any information regarding the errors.

salva | Thu, 2009-11-05 08:30

ssh: edrops.musicnet.com : Name or service not known

that means ssh can not resolve the IP address for edrops.musicnet.com. Are you able to connect with ssh to that server from the same machine where you are running the script?

Regarding the second error, set $Net::SFTP::Debug = -1; at the beginning of your script, rerun it and post here the output and also the script source code.